Hi all,<br><br>i have a project in c++ that needs program_options library from boost, i use FindBoost to set include dirs and linking stuff.<br>Compiling and linking works flawlessly under linux. With the visual studio project compiling go well but linking fails with this error message:<br>
<br>1>pro_cli.obj : error LNK2001: unresolved external symbol "public: static unsigned int const boost::program_options::options_description::m_default_line_length" (?m_default_line_length@options_description@program_options@boost@@2IB)<br>
1>pro_cli.obj : error LNK2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > boost::program_options::arg" (?arg@program_options@boost@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)<br>
1>C:\pro\build\cli\Debug\pro_cli.exe : fatal error LNK1120: 2 unresolved externals<br><br>FindBoost under windows find the correct library name and include path. The CMakeLists.txt follows:<br><br>find_package(Boost COMPONENTS program_options REQUIRED)<br>
<br>include_directories(${Boost_INCLUDE_DIRS})<br>link_directories(${Boost_LIBRARY_DIRS})<br><br>add_executable(pro_cli pro_cli.cpp)<br>target_link_libraries(pro_cli<br>${Boost_LIBRARIES}<br>)<br><br>Do you have any idea why this happen? the same CMakeLists.txt works under linux so i thinks it is not wrong.<br>
<br>Thank you,<br>Mario<br><br>