Search code examples
boost-build

boost build site-config.jam on gentoo


I am using boost build in my project and now i want to use boost date_time. I've googled and found that it should (probably) be used this way:

exe test : test.cpp /boost/date_time//date_time ;

but then i get this message:

error: Unable to find file or target named
error:     '/boost/date_time//date_time'
error: referred from project at
error:     '.'

(when i use -lboost_date_time as a gcc flag manually, then it works correctly) I thought that the library oly has to be added to site-config.jam, so i tried adding this:

project /boost/date_time ;
lib date_time ;

but it has no effect.

What am i doing wrong?

Thaks

Edit: I'm not looking for a solution that just works. I need something that will work for everyone with correct install of boost.build and boost libraries.


Solution

  • I recommend that you take a look at contrib/boost.jam module in the current versions of Boost.Build. It allows you to declare necessary targets for every library almost automatically.

    Or original attempt is not exactly right. To have "/site-config//boost_date_time" working you need to have this in site-config.jam:

    project site-config ;
    searched-lib boost_date_time ;
    

    This will work, on Linux, if the library file is named libboost_date_time.so (which is the case if Boost was built with --layout=system). On Windows, you don't actually need anything of that, thanks to autolinking.