c++ - How to link boost using cmake on windows -


the stackoverflow community!

i'm trying link boost libraries , there's error of linking 'boost_system' static library.
i use cmake 2.8, mingw compiler , 1.55.0 boost.
judging logs, cmake doesn't see pathway libraries.


here's error:

unable find requested boost libraries.  boost version: 1.55.0  boost include path: c:/local/boost_1_55_0  not find following static boost libraries:        boost_system  no boost libraries found.  may need set boost_librarydir directory containing boost libraries or boost_root location of boost. call stack (most recent call first): 


here's cmake code:

cmake_minimum_required(version 2.8) project(test)  if (win32)  set(boost_root "c:/local/boost_1_55_0") set(boost_librarydir ${boost_root}/stage/lib/) set(boost_use_static_libs on) set(boost_multithreaded on) set(boost_use_static_runtime off)  find_package(boost 1.55 components system required) add_definitions(${boost_lib_diagnostic_definitions})  set(cmake_cxx_flags "${cmake_cxx_flags} -static-libgcc -static-libstdc++")  include_directories(${boost_include_dir})   set(source_files main.cpp) add_executable(test ${source_files})  target_link_libraries(test ${boost_libraries})  endif (win32) 

i receive logs declared set(boost_detailed_failure_msg on)

status** boost include: c:/local/boost_1_55_0 status** boost libraries:  status** boost libraries:  


Comments