boostorg / boostorg/program_options
boost_program_options failed to link due to undefined references
- Vorherrschende Sprache
- C++
- Sterne
- 136
- Forks
- 117
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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*
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Start with the CMake configuration shown in the issue, especially find_package and target_link_libraries, then reproduce the Ubuntu x86_64 build using GCC 7.4.0, CMake 3.14, and Boost 1.71. Done means the program using boost::program_options links without the reported undefined references.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cmake, cpp
- Bereich
- build-system
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100