cmake is using the wrong cboost libs

2019-08-22 03:08发布

问题:

i try to compile a program with cmake, but I got stock with this error:

  Unable to find the requested Boost libraries.

  Boost version: 1.34.1

  Boost include path: /usr/include

  Detected version of Boost is too old.  Requested version was 1.37 (or
  newer).

  The following Boost libraries could not be found:

          boost_program_options
          boost_filesystem

  No Boost libraries were found.  You may need to set Boost_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.

I installed already the new boost package under /home/dev/boost_1_45_0.

But always when I try to run cmake again I get still the same error.

I also set

export BOOST_ROOT=/home/dev/boost_1_45_0

But when I execute cd ${BOOST_ROOT} I'm in the right folder.

Can anybody help me? Thanks!

回答1:

Try to delete your build tree, and then run:

cmake -DBOOST_ROOT=/home/dev/boost_1_45_0 path/to/src path/to/build


标签: boost cmake