1

i have a problem with boost 1.54.

At the moment i have my main.cpp and when i output my boost version i tells me 1.54 that is fine. I get this with

LD_LIBRARY_PATH=/path/boost_1_54_0:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
LD_LIBRARY_PATH=/path/boost_1_54_0/stage/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH 
CPLUS_INCLUDE_PATH=/path/boost_1_54_0:${CPLUS_INCLUDE_PATH}
export CPLUS_INCLUDE_PATH

the problem is when i said to my Cmake

find_package(Boost 1.54.0 COMPONENTS system log REQUIRED)

instead of

find_package(Boost COMPONENTS system log REQUIRED)

i get an error that the newest version is 1.46 my system version. So my Cmake didnt found the right boost path.

What is the correct way to give this path to cmake?

set(Boost_ADDITIONAL_VERSIONS "1.54.0" )
set(BOOST_ROOT path/boost_1_54_0)
set(BOOST_INCLUDEDIR path/boost_1_54_0)
set(BOOST_LIBRARYDIR path/boost_1_54_0/lib)

i tried this but it isn't working.

The reason for changing this running system is that i want to use Boost log and when i start the trivial example i get

undefined reference to `boost::log::v2_mt_posix::trivial::logger::get()'

but this problem is solved here

Boost.Log with CMake causing undefined reference error

But for this solving i need the correct boost version on CMAKE

thank you for your help and sry i am really new on using cmake

4

1 に答える 1