boost 文件系统 (1.63) 在对 QNX 进行交叉编译后失败并出现未定义的引用错误

boost filesystem (1.63) fails with undefined reference error after cross compiling for QNX

提问人:ZincFur 提问时间:6/26/2017 更新时间:7/14/2017 访问量:577

问:

我已经为 QNX 交叉编译了 boost,并且所有构建文件都存在于路径下 /home/hari1234/qnx_cross_compile/src/arm/boost_1_63_0/build/include 和 /主页/hari1234/qnx_cross_compile/src/arm/boost_1_63_0/build/lib

我正在尝试从源代码编译 ROS,但它失败了

/opt/qnx/install/host/linux/x86_64/usr/bin/arm-unknown-nto-qnx7.0.0eabi-ld:警告:bin.v2/libs/system/build/qcc-arm/release/target-os-qnx/threading-multi/libboost_system.so.1.63.0,/home/hari1234/qnx_cross_compile/src/arm/boost_1_63_0/build/lib/libboost_filesystem.so 需要,未找到(尝试使用 -rpath 或 -rpath-link) /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so:警告:“tmpnam”功能很危险。请改用“mkstemp”。 /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so:警告:“tempnam”功能很危险。请改用“mkstemp”。 /opt/qnx/install/host/linux/x86_64/usr/bin/arm-unknown-nto-qnx7.0.0eabi-ld:警告:bin.v2/libs/system/build/qcc-arm/release/target-os-qnx/threading-multi/libboost_system.so.1.63.0,/home/hari1234/qnx_cross_compile/src/arm/boost_1_63_0/build/lib/libboost_filesystem.so 需要,未找到(尝试使用 -rpath 或 -rpath-link) /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so:对 boost::p rogram_options::abstract_variables_map::operator[](std::__1::basic_string, std::__1::allocator > const&) const' 的未定义引用 /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so:对 boost::p rogram_options::d etail::cmdline::cmdline(std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > const&)' /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so:对 boost::p rogram_options::arg' 的未定义引用 /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so:未定义对“boost::p rogram_options::value_semantic_codecvt_helper::p arse(boost::any&, std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > const&, bool) const' 抄送:/opt/qnx/install/host/linux/x86_64/usr/bin/arm-unknown-nto-qnx7.0.0eabi-ld 错误 1 CMakeFiles/rospackexe.dir/build.make:106:目标“/opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/bin/rospack”的配方失败boost::program_options::validate(boost::any&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, int)' /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so: undefined reference toboost::program_options::options_description::options_description(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, unsigned int)' /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so: undefined reference toboost::program_options::to_internal(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)' /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so: undefined reference to

该警告表明 libboost_filesystem.so 会查找未找到的 bin.v2/libs/system/build/qcc-arm/release/target-os-qnx/threading-multi/libboost_system.so.1.63.0。我不确定在交叉编译 QNX 提升时是否要生成 bin.v2 文件夹。我认为这就是发生 boost::filesystem::validate 的未定义引用错误的原因。

任何指示或帮助将不胜感激

提前致谢

C++ Boost 交叉编译 ROS undefined-reference

评论


答:

0赞 ZincFur 7/14/2017 #1

我能够通过将 boost 库编译为静态库而不是动态库来解决这个问题。有人告诉我,原来的问题必须与设置rpath有关