c++ - Cmake cannot find Boost any longer -


until yesterday, program compiled , linked correctly. since today, same program (same source , same environment), not link. boost library not found.

top of cmakelists.txt file:

... find_package (boost required) set (boost_use_static_libs on) set (boost_use_multithreaded off) set (boost_use_static_runtime off) find_package (boost components program_options)  if (boost_found)     include_directories(${boost_include_dirs}) endif() ... 

running cmake:

cmake -dcmake_build_type=release -dbuild_documentation=on ../numberpuncher/ -- c compiler identification gnu 4.7.1 -- cxx compiler identification gnu 4.7.1 -- check working c compiler: /usr/bin/gcc -- check working c compiler: /usr/bin/gcc -- works -- detecting c compiler abi info -- detecting c compiler abi info - done -- check working cxx compiler: /usr/bin/c++ -- check working cxx compiler: /usr/bin/c++ -- works -- detecting cxx compiler abi info -- detecting cxx compiler abi info - done -- boost version: 1.49.0 -- not find boost -- configuring done -- generating done -- build files have been written to: /swenvironment/sw/numberpuncher_prj/release 

the line:

-- boost version: 1.49.0

is wrong, since boost have installed 1.54.0. however, in cmakelists.txt file, boost version not specified , not need be.

building program, link errors relative boost of kind:

entrypoint.cpp:(.text.startup+0x6be): undefined reference `boost::program_options::options_description::add_options()' 

at first thought directory containing boost had been removed, still there.

i made clean build, rerunning cmake, problem remains.

any idea?

environment:
linux opensuse 12.2
gcc/g++ 4.7.1
boost 1.54.0

moving find_package(boost components program_options) command find_package(boost required) fixed problem:

find_package (boost components program_options) set (boost_use_static_libs on) set (boost_use_multithreaded off) set (boost_use_static_runtime off) 

i still cannot understand why has worked in past. if clarify appreciate. anyway should work in future, too.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -