簡體   English   中英

BuildFailed錯誤:無法使用qibuild構建C ++ SDK Helloworld

[英]BuildFailed Error: Cannot build C++ SDK Helloworld with qibuild

我正在嘗試在Linux 18.04.1(VirtualBox)上安裝NaoQI C ++ SDK。 我遵循以下安裝說明: http : //doc.aldebaran.com/2-1/dev/cpp/install_guide.html

我的問題是在E部分第3步中,當我嘗試運行“ qibuild make”時

我在嘗試構建helloworld示例時收到此錯誤:

CMakeFiles / testhelloworld.dir / testhelloworld.cpp.o:在main': /home/nounou/Documents/SDKfolder/naoqi-sdk/doc/dev/cpp/examples/core/helloworld/testhelloworld.cpp:35: undefined reference to函數中main': /home/nounou/Documents/SDKfolder/naoqi-sdk/doc/dev/cpp/examples/core/helloworld/testhelloworld.cpp:35: undefined reference to AL :: ALBroker :: createBroker(std :: __ cxx11 :: basic_string,std :: allocator> const&,std :: __ cxx11 :: basic_string,std :: allocator> const&,int,std :: __ cxx11 :: basic_string,std :: allocator> const&,int,int,std :: __ cxx11 :: basic_string,std :: allocator>,bool)'/ home / nounou / Documents / SDKfolder / naoqi-sdk / doc / dev / cpp / examples / core / helloworld / testhelloworld.cpp:38:未定義對AL::ALProxy::ALProxy(boost::shared_ptr<AL::ALBroker>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int)' CMakeFiles/testhelloworld.dir/testhelloworld.cpp.o: In function qi :: log :: AL::ALProxy::ALProxy(boost::shared_ptr<AL::ALBroker>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int)' CMakeFiles/testhelloworld.dir/testhelloworld.cpp.o: In function :: AL::ALProxy::ALProxy(boost::shared_ptr<AL::ALBroker>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int)' CMakeFiles/testhelloworld.dir/testhelloworld.cpp.o: In function ()'中:

....

CMakeFiles / testhelloworld.dir / build.make:113:目標'sdk / bin / testhelloworld'的配方制作失敗[2]: * [sdk / bin / testhelloworld]錯誤1 CMakeFiles / Makefile2:67:目標'CMakeFiles / testhelloworld.dir / all'失敗make [1]:* [CMakeFiles / testhelloworld.dir / all]錯誤2 Makefile:129:目標“ all”的配方失敗make:*** [all]錯誤2

[錯誤]:構建項目Hello World時發生BuildFailed錯誤

如果您對問題有任何了解,請幫助我。 謝謝!

由於過渡到C ++ 11,最有可能遇到ABI不兼容的問題。 您正在使用Ubuntu 18.04,該編譯器已配置為與現代C ++庫鏈接,但是該工具鏈是使用以前的ABI進行編譯的,並且不執行編譯器標志來確保兼容性。

要解決此問題,請執行以下任一操作:

  • 設置編譯器標志,以確保您未鏈接到C ++ 11庫(如果有人知道它們,請共享)。
  • 通過使用跨工具鏈而不是Linux工具鏈,為機器人而不是您的機器進行編譯。
  • 按照安裝指南中的說明使用Ubuntu 12.04。

順便說一句,在C ++安裝指南的E.4小節中,它說要在core/sayhelloworld下編譯示例。 在這里,您將示例編譯在core/helloworld

我在Fedora 29上遇到了同樣的問題...經過幾個小時的搜索,我發現將set(CMAKE_CXX_FLAGS“ -D_GLIBCXX_USE_CXX11_ABI = 0”)添加到CMakeLists.txt文件可以解決此問題。

我在這里找到了解決方案: 即使明確指定了98,也使用c ++ 11標准的gcc

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM