我正在尝试编译doppia的CPU代码(第2步:cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo . && make
)。
我遇到麻烦的依赖是Boost。 Doppia在开始时找不到Boost(No Boost libraries were found.
)并且安装libboost-dev和libboost-all-dev并没有改变它(我希望通过手动安装)。所以我继续进行手动安装,如Boost 1.55.0的http://blog.ovidiuparvu.com/how-to-install-boost-on-ubuntu-pc所述。在最后的"链接CXX可执行文件ground_estimation"过程中,doppia抱怨很多undefined references to boost::program_options::...
。
如何用Boost解决混乱,以便编码多普勒?
完整的错误日志:
CMakeFiles/ground_estimation.dir/GroundEstimationApplication.cpp.o: In function `doppia::GroundEstimationApplication::get_options_description()':
/home/peddet/Documents/code/doppia/src/applications/ground_estimation/GroundEstimationApplication.cpp:89: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/GroundEstimationApplication.cpp.o: In function `boost::program_options::typed_value<std::string, char>::xparse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&) const':
/usr/include/boost/program_options/detail/value_semantic.hpp:170: undefined reference to `boost::program_options::validate(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, std::string*, int)'
CMakeFiles/ground_estimation.dir/GroundEstimationApplication.cpp.o: In function `boost::program_options::typed_value<bool, char>::xparse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&) const':
/usr/include/boost/program_options/detail/value_semantic.hpp:170: undefined reference to `boost::program_options::validate(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, bool*, int)'
CMakeFiles/ground_estimation.dir/GroundEstimationApplication.cpp.o: In function `boost::program_options::variables_map::operator[](std::string const&) const':
/usr/include/boost/program_options/variables_map.hpp:155: undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
/usr/include/boost/program_options/variables_map.hpp:155: undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
CMakeFiles/ground_estimation.dir/GroundEstimationApplication.cpp.o: In function `boost::program_options::typed_value<std::string, char>::name() const':
/usr/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to `boost::program_options::arg'
CMakeFiles/ground_estimation.dir/GroundEstimationApplication.cpp.o: In function `boost::program_options::typed_value<bool, char>::name() const':
/usr/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to `boost::program_options::arg'
CMakeFiles/ground_estimation.dir/GroundEstimationApplication.cpp.o:(.rodata._ZTVN5boost15program_options11typed_valueIbcEE[_ZTVN5boost15program_options11typed_valueIbcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, bool) const'
CMakeFiles/ground_estimation.dir/GroundEstimationApplication.cpp.o:(.rodata._ZTVN5boost15program_options11typed_valueISscEE[_ZTVN5boost15program_options11typed_valueISscEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, bool) const'
CMakeFiles/ground_estimation.dir/GroundEstimationGui.cpp.o: In function `doppia::GroundEstimationGui::get_args_options()':
/home/peddet/Documents/code/doppia/src/applications/ground_estimation/GroundEstimationGui.cpp:47: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/GroundEstimationGui.cpp.o: In function `boost::program_options::variables_map::operator[](std::string const&) const':
/usr/include/boost/program_options/variables_map.hpp:155: undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/applications/BaseApplication.cpp.o: In function `doppia::BaseApplication::get_options_description(std::string)':
/home/peddet/Documents/code/doppia/src/applications/BaseApplication.cpp:106: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/applications/BaseApplication.cpp.o: In function `doppia::BaseApplication::parse_arguments(int, char**, boost::program_options::variables_map&)':
/home/peddet/Documents/code/doppia/src/applications/BaseApplication.cpp:163: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/applications/BaseApplication.cpp.o: In function `std::vector<std::string, std::allocator<std::string> > boost::program_options::to_internal<std::string>(std::vector<std::string, std::allocator<std::string> > const&)':
/usr/include/boost/program_options/detail/convert.hpp:79: undefined reference to `boost::program_options::to_internal(std::string const&)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/applications/BaseApplication.cpp.o: In function `boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*)':
/usr/include/boost/program_options/detail/parsers.hpp:43: undefined reference to `boost::program_options::detail::cmdline::cmdline(std::vector<std::string, std::allocator<std::string> > const&)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/applications/BaseSdlGui.cpp.o: In function `doppia::BaseSdlGui::get_args_options()':
/home/peddet/Documents/code/doppia/src/applications/BaseSdlGui.cpp:45: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o: In function `doppia::AbstractDisparityCostVolumeEstimator::get_args_options()':
/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp:16: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o: In function `boost::program_options::typed_value<float, char>::name() const':
/usr/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to `boost::program_options::arg'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o: In function `boost::program_options::typed_value<int, char>::name() const':
/usr/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to `boost::program_options::arg'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o: In function `boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::string const&, std::string const&, int)':
/usr/include/boost/program_options/errors.hpp:372: undefined reference to `boost::program_options::validation_error::get_template(boost::program_options::validation_error::kind_t)'
/usr/include/boost/program_options/errors.hpp:372: undefined reference to `boost::program_options::error_with_option_name::error_with_option_name(std::string const&, std::string const&, std::string const&, int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o: In function `void boost::program_options::validate<float, char>(boost::any&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, float*, long)':
/usr/include/boost/program_options/detail/value_semantic.hpp:92: undefined reference to `boost::program_options::invalid_option_value::invalid_option_value(std::string const&)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o: In function `void boost::program_options::validate<int, char>(boost::any&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, int*, long)':
/usr/include/boost/program_options/detail/value_semantic.hpp:92: undefined reference to `boost::program_options::invalid_option_value::invalid_option_value(std::string const&)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o:(.rodata._ZTVN5boost15program_options16validation_errorE[_ZTVN5boost15program_options16validation_errorE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o:(.rodata._ZTVN5boost15program_options11typed_valueIicEE[_ZTVN5boost15program_options11typed_valueIicEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, bool) const'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o:(.rodata._ZTVN5boost15program_options11typed_valueIfcEE[_ZTVN5boost15program_options11typed_valueIfcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, bool) const'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE]+0x38): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o:(.rodata._ZTVN5boost15program_options20invalid_option_valueE[_ZTVN5boost15program_options20invalid_option_valueE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/AbstractDisparityCostVolumeEstimator.cpp.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE]+0x38): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/DisparityCostVolumeEstimator.cpp.o: In function `doppia::DisparityCostVolumeEstimator::get_args_options()':
/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/DisparityCostVolumeEstimator.cpp:29: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/DisparityCostVolumeEstimator.cpp.o: In function `boost::program_options::variables_map::operator[](std::string const&) const':
/usr/include/boost/program_options/variables_map.hpp:155: undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/DisparityCostVolumeEstimatorFactory.cpp.o: In function `doppia::DisparityCostVolumeEstimatorFactory::get_args_options()':
/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/DisparityCostVolumeEstimatorFactory.cpp:52: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/FastDisparityCostVolumeEstimator.cpp.o: In function `doppia::FastDisparityCostVolumeEstimator::get_args_options()':
/home/peddet/Documents/code/doppia/src/stereo_matching/cost_volume/FastDisparityCostVolumeEstimator.cpp:23: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/AbstractStereoMatcher.cpp.o: In function `doppia::AbstractStereoMatcher::get_args_options()':
/home/peddet/Documents/code/doppia/src/stereo_matching/AbstractStereoMatcher.cpp:25: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/AbstractStereoBlockMatcher.cpp.o: In function `doppia::AbstractStereoBlockMatcher::get_args_options()':
/home/peddet/Documents/code/doppia/src/stereo_matching/AbstractStereoBlockMatcher.cpp:14: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/SimpleBlockMatcher.cpp.o: In function `doppia::SimpleBlockMatcher::get_args_options()':
/home/peddet/Documents/code/doppia/src/stereo_matching/SimpleBlockMatcher.cpp:15: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/ConstantSpaceBeliefPropagation.cpp.o:/home/peddet/Documents/code/doppia/src/stereo_matching/ConstantSpaceBeliefPropagation.cpp:22: more undefined references to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)' follow
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/ConstantSpaceBeliefPropagation.cpp.o: In function `boost::program_options::typed_value<short, char>::name() const':
/usr/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to `boost::program_options::arg'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/ConstantSpaceBeliefPropagation.cpp.o: In function `boost::program_options::variables_map::operator[](std::string const&) const':
/usr/include/boost/program_options/variables_map.hpp:155: undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/ConstantSpaceBeliefPropagation.cpp.o: In function `void boost::program_options::validate<short, char>(boost::any&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, short*, long)':
/usr/include/boost/program_options/detail/value_semantic.hpp:92: undefined reference to `boost::program_options::invalid_option_value::invalid_option_value(std::string const&)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/ConstantSpaceBeliefPropagation.cpp.o:(.rodata._ZTVN5boost15program_options11typed_valueIscEE[_ZTVN5boost15program_options11typed_valueIscEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, bool) const'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/OpenCvStereo.cpp.o: In function `doppia::OpenCvStereo::get_args_options()':
/home/peddet/Documents/code/doppia/src/stereo_matching/OpenCvStereo.cpp:94: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/ground_plane/BaseGroundPlaneEstimator.cpp.o: In function `doppia::BaseGroundPlaneEstimator::get_args_options()':
/home/peddet/Documents/code/doppia/src/stereo_matching/ground_plane/BaseGroundPlaneEstimator.cpp:64: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/ground_plane/FastGroundPlaneEstimator.cpp.o: In function `doppia::FastGroundPlaneEstimator::get_args_options()':
/home/peddet/Documents/code/doppia/src/stereo_matching/ground_plane/FastGroundPlaneEstimator.cpp:65: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/ground_plane/GroundPlaneEstimator.cpp.o: In function `doppia::GroundPlaneEstimator::get_args_options()':
/home/peddet/Documents/code/doppia/src/stereo_matching/ground_plane/GroundPlaneEstimator.cpp:69: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/stereo_matching/ground_plane/GroundPlaneMovingAverage.cpp.o: In function `doppia::GroundPlaneMovingAverage::get_args_options()':
/home/peddet/Documents/code/doppia/src/stereo_matching/ground_plane/GroundPlaneMovingAverage.cpp:15: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/ground_estimation.dir/home/peddet/Documents/code/doppia/src/video_input/AbstractVideoInput.cpp.o:/home/peddet/Documents/code/doppia/src/video_input/AbstractVideoInput.cpp:19: more undefined references to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)' follow
collect2: error: ld returned 1 exit status
CMakeFiles/ground_estimation.dir/build.make:1791: recipe for target 'ground_estimation' failed
make[2]: *** [ground_estimation] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ground_estimation.dir/all' failed
make[1]: *** [CMakeFiles/ground_estimation.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
答案 0 :(得分:0)
所有undefined reference
问题始终都与链接到方法定义文件有关。您的库/目标文件丢失或库/目标文件不包含方法定义或方法签名不匹配。