Boost logo

Boost-Build :

Subject: [Boost-build] linking Boost.Test in a project outside boost
From: Mathieu Champlon (m.champlon_at_[hidden])
Date: 2013-05-09 16:17:32


Hi,

I'm having a hard time linking my Boost.Test for the unit tests of a
project using outside of boost.
Here is the error issued by bjam:

~~~~~~
msvc.link bin\test_constraints.test\msvc-10.0\debug\test_constraints.exe
LINK : fatal error LNK1104: cannot open file
'boost_unit_test_framework-vc100-mt-gd-1_54.lib'
~~~~~~

I used http://svn.boost.org/svn/boost/sandbox/type_erasure as an example.
Here is my Jamroot.jam at the root of my project :

~~~~~~
import modules ;

local boost = [ modules.peek : BOOST ] ;

project mock : requirements <include>$(boost) <include>. ;

use-project /boost : $(boost) ;
~~~~~~

Also at the root of my project is Jamfile.v2 :

~~~~~~
if [ GLOB $(BOOST) : [ modules.peek project : JAMFILE ] ]
{
     use-project /boost : $(BOOST) ;
}
~~~~~~

And finally Jamfile.jam in the libs/mock/test sub-directory :

~~~~~~
import testing ;

run test_constraints.cpp /boost//unit_test_framework ;
~~~~~~

I also have the following environment variables :

~~~~~~
BOOST=C:\dev\home\cpp\boost
BOOST_BUILD_PATH=C:\dev\home\cpp\boost\tools\build\v2
BOOST_ROOT=C:\dev\home\cpp\boost
~~~~~~

As a prerequisite bjam builds Boost.Test in
C:\dev\home\cpp\boost\bin.v2\libs\test\build\msvc-10.0\debug\asynch-exceptions-on
and the .lib is named correctly.
And if I run it with -n here is the relevant part of the output :

~~~~~~
file bin\test_constraints.test\msvc-10.0\debug\test_constraints.exe.rsp

"C:\dev\home\cpp\boost\bin.v2\libs\test\build\msvc-10.0\debug\asynch-exceptions-on\boost_unit_test_framework-vc100-gd-1_54.lib"
"bin\test_constraints.test\msvc-10.0\debug\test_constraints.obj"
msvc.link bin\test_constraints.test\msvc-10.0\debug\test_constraints.exe

         call "C:\Program Files (x86)\Microsoft Visual Studio
10.0\vc\vcvarsall.bat" x86 >nul
link /NOLOGO /INCREMENTAL:NO /DEBUG /MACHINE:X86 /subsystem:console
/out:"bin\test_constraints.test\msvc-10.0\debug\test_constraints.exe"
@"bin\test_constraints.test\msvc-10.0\debug\test_constraints.exe.rsp"
  ~~~~~~

The .lib appears to be missing from the command line.

I'm using bjam built from trunk revision 84050.

What am I missing ?

Thank you !
MAT.


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk