• 10
• 27
• 9
• 20
• 31

# Building boost::system with bjam

This topic is 3822 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I'm a totally new to bjam, so please have mercy on me. I'm trying to build the system-lib for msvc-80 in order to use boost::asio, however I'm facing a problem. I simply run bjam --with-system (from ...\system\build) with the following results: C:\Program Files\boost\boost_1_34_1\libs\system\build>bjam --with-system warning: No toolsets are configured. warning: Configuring default toolset "msvc". warning: If the default is wrong, you may not be able to build C++ programs. warning: Use the "--toolset=xxxxx" option to override our guess. warning: For more configuration options, please consult warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html ...patience... ...found 195 targets... ...updating 9 targets... MkDir1 ..\..\..\bin.v2 MkDir1 ..\..\..\bin.v2\libs MkDir1 ..\..\..\bin.v2\libs\system MkDir1 ..\..\..\bin.v2\libs\system\build MkDir1 ..\..\..\bin.v2\libs\system\build\msvc MkDir1 ..\..\..\bin.v2\libs\system\build\msvc\debug compile-c-c++ ..\..\..\bin.v2\libs\system\build\msvc\debug\error_code.obj 'cl' is not recognized as an internal or external command, operable program or batch file. cl /Zm800 -nologo @"..\..\..\bin.v2\libs\system\build\msvc\debug\error_code. obj.rsp" ...failed compile-c-c++ ..\..\..\bin.v2\libs\system\build\msvc\debug\error_code. obj... ...skipped <p..\..\..\bin.v2\libs\system\build\msvc\debug>boost_system-vc-gd-1_3 4_1.dll for lack of <p..\..\..\bin.v2\libs\system\build\msvc\debug>error_code.ob j... ...skipped <p..\..\..\bin.v2\libs\system\build\msvc\debug>boost_system-vc-gd-1_3 4_1.lib for lack of <p..\..\..\bin.v2\libs\system\build\msvc\debug>error_code.ob j... ...failed updating 1 target... ...skipped 2 targets... ...updated 6 targets... Any ideas on how to get it done? Many thanks in advance for any help.

##### Share on other sites
Looks like bjam can't find your compiler.

Quote:
 'cl' is not recognized as an internal or external command,operable program or batch file.

* bjam tries to autodetect compiler and version, but it seems to be failing in
your case. (Works for me with visual studio 7.1 and Visual studio Express 8)
* What version of visual studio do you have installed?
* try running the appropriate vcvars32.bat or vcvarsall.bat inside of your command prompt.
* Try specifying the version
--toolset=msvc-<version>

##### Share on other sites
I'm using VC 9.0 Express Edition (Orcas).

I ran both of the .bat files, and that already helped alot. I know ran bjam from the same location (system's build dir): bjam --toolset=msvc-8.0 --with-system

It runs without any errors, and creates msvc-8.0\debug\threading-multi dirs in system's build dir. The dir contains both the .lib and .dll, which are named boost_system-vc80-mt-gd-1_34_1.(lib/dll). Okay, so far so good.

I tried to compile the following:
#define _WIN32_WINNT 0X0501#include <boost/asio.hpp>int main() { }

Got a couple of errors, all because of this linker error, I believe:
LINK : fatal error LNK1104: cannot open file 'libboost_system-vc80-mt-gd-1_34_1.lib'

I renamed the boost_system... to libboost_system... and tried again. The program compiled, ran and splashed an error at me saying: "Unable To Locate Component. This application has failed to start because boost_system_vc80-mt-gd-1_34_1.dll was not found. Re-installing the application may fix the problem." However, doing the same renaming with the previously created .dll didn't fix or change the problem at all.

Shortly put my question is, is it ok to rename the .lib file in the first place? What arguments must I supply bjam with in order to create the correct, and correctly named files?

Thanks RavenKnight!

##### Share on other sites
Right, the essential bjam-arguments were threading=multi and link=static. Got it up and running, thanks.