Hi all,
i have a project in c++ that needs program_options library from boost, i
use FindBoost to set include dirs and linking stuff.
Compiling and linking works flawlessly under linux. With the visual studio
project compiling go well but linking fails with this error message:
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)
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)
1>C:\pro\build\cli\Debug\pro_cli.exe : fatal error LNK1120: 2 unresolved
externals
FindBoost under windows find the correct library name and include path. The
CMakeLists.txt follows:
find_package(Boost COMPONENTS program_options REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
add_executable(pro_cli pro_cli.cpp)
target_link_libraries(pro_cli
${Boost_LIBRARIES}
)
Do you have any idea why this happen? the same CMakeLists.txt works under
linux so i thinks it is not wrong.
Thank you,
Mario
--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake