Issam T.
Issam T.

Reputation: 1697

Cmake not using the right boost library

I have two versions of boost:

As I want to use the second one, I call cmake to create my makefile and i compile my project this way:

cmake -DBOOST_ROOT=/usr/local/Cellar/boost/1.54.0/ .
make

And I get this error:

/usr/local/include/boost/functional/hash/extensions.hpp:54:17: error: 
  variable 'hash_value' declared as a template
std::size_t hash_value(std::list<T, A> const& v);
            ^

Clearly the boost version that is used is not the one I mentioned using BOOST_ROOT . How do I make sure that the version of boost that is used is the one in /usr/local/Cellar/boost/1.54.0/ ?

Thanks in advance

Upvotes: 0

Views: 147

Answers (1)

lrineau
lrineau

Reputation: 6274

My guess is that you have another dependency that requires -I/usr/local/include/ in the flags, and that that -I flags is seen by the compiler before -I/usr/local/Cellar/boost/1.54.0/include.

Debug your compilation process with:

make VERBOSE=1

to see the compilation commands that are used.

Upvotes: 1

Related Questions