Marc Andreson
Marc Andreson

Reputation: 3495

Boost.Build link against boost libraries

I am trying to link against boost libraries from Jamfile:

import os ;
path-constant BOOST_ROOT : [ os.environ BOOST_ROOT ] ;
use-project /boost : $(BOOST_ROOT) ;

exe hello :
            hello.cpp
            /boost//filesystem
            /boost//system
          :
            <link>static
          ;

Although I can see from the console output that the libraries are compiled, the linker outputs an error:

msvc.link bin\msvc-10.0\debug\link-static\hello.exe
LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc100-mt-gd-1_46.lib'

Why there is an error reported? I AM linking against the library from the level of Jamfile, so why the library is not linked when it should be? To my understanding, if the entire build process is controlled by Jamfiles, the library should be automatically linked statically, and no compiler-specific flags should be added (as it would made Jamfiles less portable). Please help.

Upvotes: 1

Views: 889

Answers (1)

user1252091
user1252091

Reputation:

You are probably having problems with boost's auto link feature. You can disable it by defining BOOST_ALL_NO_LIB (I suppose adding <define>BOOST_ALL_NO_LIB to the requirements of the target hello would suffice).

Upvotes: 2

Related Questions