1. 程式人生 > >cartographer安裝catkin_make_isolated --install --use-ninja報錯

cartographer安裝catkin_make_isolated --install --use-ninja報錯

cartographer安裝報錯,上一篇介紹了安裝過程,不過在安裝官網教程時出現了好多錯誤,下面貼出來:

安裝出錯主要是官網的安裝有問題,具體安裝參考上一篇,

安裝前幾步都沒問題,一直到下面這一步.

src/cartographer/scripts/install_proto3.sh

這裡請注意:對於已經安裝過得ros的人來說可能會pc上已經自帶proto 2.6.1,那就建議不要執行這一步,先繼續執行下面幾步.

具體怎麼判斷自己電腦上有沒有安裝proto,可以用:protoc --version,看看有沒有,如果有會顯示版本,如果沒有就顯示沒有.同時再多說一句,可能會有人要更新自己proto,再給個命令: which protoc檢視你安裝的位置,看他不爽直接幹掉......

執行指令碼install_proto3.sh安裝時可能會有錯,如果有錯建議開啟指令碼手動安裝,(安裝好幾遍有直接過得,也有報錯的所以自己參考)

下來就是catkin_make_isolated --install --use-ninja

這句安裝時會和報錯,我裝了好幾遍都報錯,下面貼出報錯過程,僅供參考:

libcartographer.a(normal_estimation_options_2d.pb.cc.o): In function `cartographer::mapping::proto::NormalEstimationOptions2D::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)':
normal_estimation_options_2d.pb.cc:(.text+0x9ea): undefined reference to `google::protobuf::io::CodedInputStream::ReadTagFallback(unsigned int)'
normal_estimation_options_2d.pb.cc:(.text+0xa36): undefined reference to `google::protobuf::io::CodedInputStream::ReadVarint32Fallback(unsigned int)'
libcartographer.a(normal_estimation_options_2d.pb.cc.o): In function `cartographer::mapping::proto::protobuf_cartographer_2fmapping_2fproto_2f2d_2fnormal_5festimation_5foptions_5f2d_2eproto::TableStruct::InitDefaultsImpl()':
normal_estimation_options_2d.pb.cc:(.text+0x760): undefined reference to `google::protobuf::internal::OnShutdownDestroyMessage(void const*)'
libcartographer.a(normal_estimation_options_2d.pb.cc.o): In function `void google::protobuf::Arena::Own<cartographer::mapping::proto::NormalEstimationOptions2D>(cartographer::mapping::proto::NormalEstimationOptions2D*)':
normal_estimation_options_2d.pb.cc:(.text._ZN6google8protobuf5Arena3OwnIN12cartographer7mapping5proto25NormalEstimationOptions2DEEEvPT_[_ZN6google8protobuf5Arena3OwnIN12cartographer7mapping5proto25NormalEstimationOptions2DEEEvPT_]+0xd): undefined reference to `google::protobuf::internal::ArenaImpl::AddCleanup(void*, void (*)(void*))'
libcartographer.a(normal_estimation_options_2d.pb.cc.o):(.data.rel.ro._ZTVN12cartographer7mapping5proto25NormalEstimationOptions2DE[_ZTVN12cartographer7mapping5proto25NormalEstimationOptions2DE]+0xb8): undefined reference to `google::protobuf::Message::SpaceUsedLong() const'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
<== Failed to process package 'cartographer':
  Command '['/home/funstep/catkin_ws/install_isolated/env.sh', 'ninja', '-j4', '-l4']' returned non-zero exit status 1

Reproduce this error by running:
==> cd /home/funstep/catkin_ws/build_isolated/cartographer && /home/funstep/catkin_ws/install_isolated/env.sh ninja -j4 -l4

Command failed, exiting.

這個錯誤頭疼了好久,最後才發現是proto版本導致錯誤,建議在安裝時確定好proto版本,要不會出現各種錯誤,如果你安裝好幾遍proto版本,可能會導致檢測或者依賴失敗,就算檢視版本顯示正確還是會報錯,這個時候建議最直接的辦法清空重新搞一波或者重新裝個系統(不建議,萬不得已可以重新裝).安裝過程中我還遇到各種奇葩問題,就不一一貼出來了,如果有遇到其他問題的可以留言,如果有能力會幫你解決的..........