boostorg / boostorg/program_options

boost_program_options failed to link due to undefined references

Open
#86 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
136
Forks
117
PR merge metrics
No merged PRs in 30d

Description

When building a program that uses boost::program_options a couple of undefined refereneces show up:
```
CMakeFiles/saryxo_train.dir/src/main.cpp.o: In Function »boost::program_options::basic_command_line_parser::basic_command_line_parser(int, char const* const*)«:
/usr/local/include/boost/program_options/detail/parsers.hpp:28: Warning: undefined reference to »boost::program_options::detail::cmdline::cmdline(std::__debug::vector, std::allocator >, std::allocator, std::allocator > > > const&)«
CMakeFiles/saryxo_train.dir/src/main.cpp.o:(.data.rel.ro._ZTVN5boost15program_options11typed_valueIicEE[_ZTVN5boost15program_options11typed_valueIicEE]+0x38): Warning: undefined reference to »boost::program_options::value_semantic_codecvt_helper::parse(boost::any&, std::__debug::vector, std::allocator >, std::allocator, std::allocator > > > const&, bool) const«
CMakeFiles/saryxo_train.dir/src/main.cpp.o:(.data.rel.ro._ZTVN5boost15program_options11typed_valueIjcEE[_ZTVN5boost15program_options11typed_valueIjcEE]+0x38): Warning: undefined reference to »boost::program_options::value_semantic_codecvt_helper::parse(boost::any&, std::__debug::vector, std::allocator >, std::allocator, std::allocator > > > const&, bool) const«
CMakeFiles/saryxo_train.dir/src/main.cpp.o:(.data.rel.ro._ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE[_ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE]+0x38): Warning: undefined reference to »boost::program_options::value_semantic_codecvt_helper::parse(boost::any&, std::__debug::vector, std::allocator >, std::allocator, std::allocator > > > const&, bool) const«
CMakeFiles/saryxo_train.dir/src/main.cpp.o: In Function »boost::program_options::typed_value, std::allocator >, char>::xparse(boost::any&, std::__debug::vector, std::allocator >, std::allocator, std::allocator > > > const&) const«:
/usr/local/include/boost/program_options/detail/value_semantic.hpp:184: Warning: undefined reference to »boost::program_options::validate(boost::any&, std::__debug::vector, std::allocator >, std::allocator, std::allocator > > > const&, std::__cxx11::basic_string, std::allocator >*, int)«
```

I am using CMake 3.14 and link boost in the CMake list like:
```
cmake_minimum_required(VERSION 3.14)
set (CMAKE_CXX_STANDARD 14)
find_package(Boost 1.70 COMPONENTS filesystem program_options REQUIRED)
...
target_link_libraries(project ${Boost_LIBRARIES})
```

*System Plattform: Ubuntu x86_64
CMake/GCC Version: 3.14/7.4.0
Boost Version: 1.71*

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.