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

时间:2017-06-26 15:12:23

标签: c++ boost cross-compiling ros undefined-reference

我已经为QNX交叉编译了提升,并且路径下存在所有构建文件 / home / hari1234 / qnx_cross_compile / src / arm / boost_1_63_0 / build / include和 /家庭/ hari1234 / qnx_cross_compile / SRC /臂/ boost_1_63_0 /建造/ lib中

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

  

/opt/qnx/install/host/linux/x86_64/usr/bin/arm-unknown-nto-qnx7.0.0eabi-ld:warning: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链接)   /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so:warning:'tmpnam'函数很危险。请改用“mkstemp”。   /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so:warning:'tempnam'函数很危险。请改用“mkstemp”。   /opt/qnx/install/host/linux/x86_64/usr/bin/arm-unknown-nto-qnx7.0.0eabi-ld:warning: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-链接)   /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so:对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 to boost :: program_options :: abstract_variables_map :: operator []的未定义引用(std :: __ 1 :: basic_string,std: :__ 1 :: allocator&gt; const&amp;)const'   /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so:未定义引用boost::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 to boost :: program_options :: detail :: cmdline :: cmdline(std :: __ 1 :: vector,std :: __ 1 :: allocator&gt;,std :: __ 1 :: allocator,std :: __ 1 :: allocator&gt;&gt;&gt; const&amp;)'   /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so:对boost::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 boost :: program_options :: arg'的未定义引用   /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so:未定义引用`boost :: program_options :: value_semantic_codecvt_helper :: parse(boost :: any&amp;,std :: __ 1 :: vector,std: :__ 1 :: allocator&gt;,std :: __ 1 :: allocator,std :: __ 1 :: allocator&gt;&gt;&gt; const&amp;,bool)const'   cc:/opt/qnx/install/host/linux/x86_64/usr/bin/arm-unknown-nto-qnx7.0.0eabi-ld error 1   CMakeFiles / rospackexe.dir / build.make:106:目标'/ opt / qnx / install / arm_catkin_ros / devel_isolated / rospack / bin / rospack'的配方失败

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

任何指针或帮助都将受到高度赞赏

提前致谢

1 个答案:

答案 0 :(得分:0)

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