【问题标题】:BuildFailed Error: Cannot build C++ SDK Helloworld with qibuild构建失败错误:无法使用 qibuild 构建 C++ SDK Hello World
【发布时间】:2019-03-12 21:03:10
【问题描述】:

我正在尝试在 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 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::LogStream::~LogStream()':

....

CMakeFiles/testhelloworld.dir/build.make:113:目标配方 'sdk/bin/testhelloworld' 失败 make[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

[ERROR]:构建项目hello world时发生BuildFailed错误

如果您对问题所在有任何想法,请帮助我。谢谢!

【问题讨论】:

  • 您的系统中缺少 ALProxy,因此编译器无法链接。它要么已安装但不在编译器可以找到的路径中,要么未安装。检查是否安装了“alcommon”库。
  • 我检查过了。安装了“alcommon”库。我该怎么做才能让编译器找到它?
  • 您安装了哪个版本的 C++ SDK? 2.1 ?
  • 列出qitoolchain info 的输出可以帮助弄清楚到底发生了什么。
  • 我已经安装了2.1.4.13版本的C++ SDK。我有一台 NAO 机器人 V4。

标签: c++ linux build cross-compiling nao-robot


【解决方案1】:

由于转换到 C++11,您很可能遇到 ABI 不兼容问题。您使用的是 Ubuntu 18.04,其编译器配置为与现代 C++ 库链接,但工具链是使用以前的 ABI 编译的,并且不强制使用编译器标志来确保兼容性。

要解决此问题,可以:

  • 设置编译器标志以确保您不会链接到 C++11 库(如果有人知道,请分享)。
  • 使用交叉工具链而不是 Linux 工具链为机器人而不是您的机器进行编译。
  • 使用 Ubuntu 12.04,如安装指南中所述。

顺便说一句,在 C++ 安装指南的 E.4 小节中,它说要编译 core/sayhelloworld 下的示例。这里你编译了core/helloworld下的例子。

【讨论】:

    【解决方案2】:

    我在 Fedora 29 上遇到了同样的问题...经过几个小时的搜索后,我发现将 set(CMAKE_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0") 添加到 CMakeLists.txt 文件可以解决问题。

    我在这里找到了解决方案: gcc using c++11 standard even though 98 explicitly specified

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-03
      • 1970-01-01
      • 2018-08-18
      • 2016-04-25
      • 1970-01-01
      • 1970-01-01
      • 2013-12-03
      • 2022-07-14
      相关资源
      最近更新 更多