构建失败错误:无法使用 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
AL::ALBroker::createBroker(std::__cxx11::basic_string, std::allocator> const&, 标准::__cxx11::basic_string, std::allocator> const&, int, std::__cxx11::basic_string, std::allocator> const&, int, int, 标准::__cxx11::basic_string, std::分配器>, 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: recipe for target 'SDK/bin/testhelloworld' make 失败[2]:* [SDK/bin/testhelloworld] 错误 1 CMakeFiles/Makefile2:67:目标配方 'CMakeFiles/testhelloworld.dir/all' 失败的制作[1]: *[CMakeFiles/testhelloworld.dir/all]错误 2 制作文件:129: 配方 目标"全部"失败制作:*** [全部] 错误 2
[错误]:构建项目时发生构建失败错误 hello world
如果您对问题是什么有任何想法,请帮助我。谢谢!
我在 Fedora 29 上遇到了同样的问题......经过几个小时的搜索,我发现将 set(CMAKE_CXX_FLAGS"-D_GLIBCXX_USE_CXX11_ABI=0"( 添加到 CMakeLists.txt 文件中解决了这个问题。
我在这里找到了解决方案: 使用 C++11 标准的 GCC,即使明确指定了 98
由于过渡到 C++11,您很可能遇到了 ABI 不兼容问题。您使用的是 Ubuntu 18.04,编译器配置为与现代C++库链接,但工具链是使用以前的 ABI 编译的,并且不强制使用编译器标志以确保兼容性。
要解决此问题,请执行以下任一操作:
- 设置编译器标志以确保您不会链接到 C++11 库(如果有人知道它们,请分享(。
- 通过使用跨工具链而不是 Linux 工具链,为机器人而不是您的机器进行编译。
- 使用 Ubuntu 12.04,如安装指南中所述。
顺便说一下,在C++安装指南的E.4小节中,它说要编译core/sayhelloworld
下的示例。在这里,您在core/helloworld
下编译了示例。
- C++为构建时间获取QDateTime的可靠方法
- 无法在 CLion 中构建 C++ 项目
- 函数向量_指针有不同的原型,我可以构建一个吗
- 如何使用ndk-build.cmd构建Android.so文件
- libssh 的函数在构建 libssh 时无法在 Qt 和 cmake 错误中找到
- 使用cmake从源代码构建MySQL连接器/C++失败(与以前的声明冲突)
- VSCode-有一个红色下划线,但程序构建和运行正确,并且出现配音错误
- 构建可组合有向图(扫描仪生成器的汤普森构造算法)
- 无法使用Qt Creator在Windows中构建yaml-cpp
- 构建一个由C和C++文件组成的库
- llvm构建器向基本块添加终止符
- FLTK 2.0构建和演示,适用于VS2019的2011年左右的代码库
- 如何跨平台将二进制资源构建到程序中?
- 将 OpenCV 与 CMAKE 中的项目一起构建为第三方库的正确方法
- 如何解决 Ninja c++ 构建和执行问题
- 使用 cmake 的 LLVM 构建在 tsan_libdispatch_mac.cc 期间失败; "Error: conflicting types for ..."
- CMake WxWidgets项目成功地在Linux上构建,但没有在Windows上构建
- 更改命令行 qt5 源代码构建配置的正确/快速方法
- 用CMake构建C++协议
- 构建失败错误:无法使用 qibuild 构建C++ SDK Helloworld