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


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:

~~~~~~ bin\test_constraints.test\msvc-10.0\debug\test_constraints.exe
LINK : fatal error LNK1104: cannot open file

I used 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 :


As a prerequisite bjam builds Boost.Test in
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

"bin\test_constraints.test\msvc-10.0\debug\test_constraints.obj" 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

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 !

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at