boostorg / boostorg/program_options
boost_program_options failed to link due to undefined references
- Lingua principale
- C++
- Stelle
- 136
- Fork
- 117
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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*
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cmake, cpp
- Ambito
- build-system
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100