Boost logo

Boost Users :

Subject: [Boost-users] [Boost.Build, Coroutine2] /usr/bin/ld: cannot find -lboost_coroutine2
From: Mikhail Strelnikov (mikhail.strelnikov_at_[hidden])
Date: 2017-02-24 21:19:55


Hello.

My Jamroot looks like this:

local BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
project my_project
    : requirements <define>BOOST_ALL_NO_LIB=1
    : build-dir bin.v2 ;
use-project /boost : $(BOOST_ROOT) ;
exe my : my_source.cpp /boost//thread /boost//coroutine2 ;

Command line:

b2 --build-dir=whatever -sBOOST_ROOT=/path/to/boost_1_63_0

I'm getting the following error:

/usr/bin/ld: cannot find -lboost_coroutine2

This happens because a library without sources:

https://github.com/boostorg/coroutine2/blob/develop/build/Jamfile.v2#L29

is a pre-built library.

Header-only library should use alias -
http://www.boost.org/build/doc/html/bbv2/faq/header-only-libraries.html

After changing "lib boost_coroutine2..." to "alias boost_coroutine2 ;"
I had to add <library>/boost//context to usage-requirements of
boost/coroutine2 project. Apparently reference to Context from
"requirements" (at line 13) is not enough in this case. Can this be a
bug in Boost.Build?

But the problem with alias is that "b2 --with-coroutine2" does not
build anything at all. My question: is it supported scenario by
Boost.Build - header-only library depending on not-header-only
library?

Bonus question: can those BOOST_DISABLE_ASSERTS be removed from
Jamfiles building Context, Coroutine2 and Fiber?

Thanks.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net