[英]How do I build boost with Visual Studio 2008 when I have multiple Visual Studio versions installed?
I know how to build boost with the latest visual studio on my machine ( this question, for example ) 我知道如何使用我的机器上的最新视觉工作室来构建增强功能( 例如,这个问题 )
However, I need to build the libs for Visual Studio 2008 (vc9) 但是,我需要为Visual Studio 2008构建库(vc9)
I tried using toolset=vc9 but I get problems/no success. 我尝试使用toolset = vc9,但我遇到问题/没有成功。
How can I build the libs for vc9? 如何为vc9构建库?
After I run boostrap I try running 运行boostrap之后我尝试运行
b2 toolset=vc9
but the output is: 但输出是:
C:/Development/boost 50/boost_1_50_0/boost_1_50_0/tools/build/v2/build\\toolset.jam:39: in toolset.using rule vc9.init unknown in module toolset
C:/ Development / boost 50 / boost_1_50_0 / boost_1_50_0 / tools / build / v2 / build \\ toolset.jam:39:在toolset.using规则vc9.init模块工具集中未知
C:/Development/boost 50/boost_1_50_0/boost_1_50_0/tools/build/v2\\build-system.jam:481: in process-explicit-toolset-requests
C:/ Development / boost 50 / boost_1_50_0 / boost_1_50_0 / tools / build / v2 \\ build-system.jam:481:in process-explicit-toolset-requests
C:/Development/boost 50/boost_1_50_0/boost_1_50_0/tools/build/v2\\build-system.jam:562: in load
C:/ Development / boost 50 / boost_1_50_0 / boost_1_50_0 / tools / build / v2 \\ build-system.jam:562:in load
C:\\Development\\boost 50\\boost_1_50_0\\boost_1_50_0\\tools\\build\\v2/kernel\\modules.jam:283: in import
C:\\ Development \\ boost 50 \\ boost_1_50_0 \\ boost_1_50_0 \\ tools \\ build \\ v2 / kernel \\ modules.jam:283:导入
C:\\Development\\boost 50\\boost_1_50_0\\boost_1_50_0\\tools\\build\\v2/kernel/bootstrap.jam:142: in boost-build
C:\\ Development \\ boost 50 \\ boost_1_50_0 \\ boost_1_50_0 \\ tools \\ build \\ v2 / kernel / bootstrap.jam:142:在boost-build中
C:\\Development\\boost 50\\boost_1_50_0\\boost_1_50_0\\boost-build.jam:17: in module scope
C:\\ Development \\ boost 50 \\ boost_1_50_0 \\ boost_1_50_0 \\ boost-build.jam:17:在模块范围内
toolset=msvc-9.0 工具集= MSVC-9.0
I have VS2008-Pro and VS2010-Express installed. 我安装了VS2008-Pro和VS2010-Express。 The default ran with VS2010.
默认情况下使用VS2010运行。 Setting toolset=msvc-9.0 caused the build to run with VS2008.
设置工具集= msvc-9.0导致构建与VS2008一起运行。 Using Boost 1.51.0.
使用Boost 1.51.0。
You'll need to dig into the How-To-Build-Boost documentation, and in particular see this ; 您需要深入了解How-To-Build-Boost文档,特别是看到这一点 ; but the part you need to specify a particular MSVC version is pointed to here .
但是这里指的是指定特定MSVC版本所需的部分。 That suggests creating a
user-config.jam
, which probably would work, but I created a project-config.jam
file instead. 这表明创建一个
user-config.jam
,这可能会起作用,但我创建了一个project-config.jam
文件。
I seem to be able to do this by running the top-level boost build (or meta build) script from different VC command lines. 我似乎能够通过从不同的VC命令行运行顶级boost构建(或元构建)脚本来做到这一点。 For example to build with VC2012, start a command line with vc 2012 vars.
例如,要使用VC2012构建,请使用vc 2012 vars启动命令行。 And for 2010, do the same.
对于2010年,做同样的事情。 The automatically generated build scripts seem to do the right thing.
自动生成的构建脚本似乎做得对。
I am sure there are ways to do this by editing the build scripts myself or by setting the toolset, but I had no success with that. 我确信有办法通过自己编辑构建脚本或设置工具集来实现这一点,但我没有成功。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.