10

I would like to build boost using two different compilers, MinGW and Visual C++ 2010 Express, using bjam:

bjam toolset=gcc,msvc variant=release link=static,shared threading=multi install

The problem is that I do not have bjam. I could not find it in the Boost directory, and the one I downloaded from somewhere else was a wrong version.

I should be able to build it from the code in Boost, but how? I read that I must launch build.bat from the BOOST_ROOT/tools/jam/src directory, but that directory does not exist !

Thank you!


  • Platform: Windows7
  • Compilers: MinGW and Visual C++ 2010 Express

Update:

I have been able to get bjam with: bootstrap.bat gcc
Then, launching bjam with the previous parameters, I only get libraries for MinGW (.dll and .a).
This is an extract of the error messages I get with regard to Visual C++ 10:

...
    call "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >nul
cl /Zm800 -nologo @"bin.v2\libs\test\build\msvc-10.0\release\asynch-exceptions-on\threading-multi\plain_report_formatter.obj.rsp"
...failed compile-c-c++ bin.v2\libs\test\build\msvc-10.0\release\asynch-exceptions-on\threading-multi\plain_report_formatter.obj...
...
...skipped <pbin.v2\libs\test\build\msvc-10.0\release\asynch-exceptions-on\threading-multi>boost_unit_test_framework-vc100-mt-1_48.dll for lack of <pbin.v2\libs\test\build\msvc-10.0\release\asynch-exceptions-on\threading-multi>compiler_log_formatter.obj...
...
common.mkdir bin.v2\libs\thread\build\msvc-10.0\release\threading-multi
common.mkdir bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32
compile-c-c++ bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32\thread.obj
\Microsoft was unexpected at this time.
...
    call "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >nul
cl /Zm800 -nologo @"bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32\thread.obj.rsp"

...failed compile-c-c++ bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32\thread.obj...
compile-c-c++ bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32\tss_dll.obj
\Microsoft was unexpected at this time.
...
...skipped <pC:\Boost\lib>boost_thread-vc100-mt-1_48.lib for lack of <pbin.v2\libs\thread\build\msvc-10.0\release\threading-multi>boost_thread-vc100-mt-1_48.lib
...

Trying to use:
bootstrap.bat vc100
I get the error: "Unknown toolset: vc100"

With either:
bootstrap.bat vc10
or:
bootstrap.bat mingw
I get: "\Microsoft was unexpected at this time."

Changing project-config.jam did not help.

So, I did a big step forward, but vc10 is not working, yet...

4

3 回答 3

5

在你的 boost 目录中有一个bootstrap.bat 。运行。

它将自动构建 bjam(可能使用 Visual C++)。

于 2011-11-30T17:34:49.977 回答
4

我认为,boost 中的目录结构在最近的版本中发生了变化。

bjam 的来源在tools/build/v2/engine. 使用 MinGW shell 从该目录运行build.sh mingw,它应该构建 bjam.exe 和 b2.exe 并将它们放在tools/build/v2/engine/ntx86. 将 b2.exe 复制到 boost 根目录。然后,您应该能够使用b2 toolset=msvc.

希望有帮助。

于 2011-12-06T13:41:20.760 回答
0

就我而言,jork 的解决方案有效!

我搜索了该bjam.exe文件,发现它位于tools/build/src/engine目录中,然后将其复制到了 boost 根目录。但我不得不说这很糟糕,我觉得代码库编写者正试图隐藏某事。我发现我bjam.exe的大小与 完全一样b2.exe,都是 404KB。

我稍后会回头以确保我解决了这个问题。

于 2021-09-29T11:41:14.730 回答