“Visual Studio 2012 Update 1”支持使用“vc110_xp”工具集来针对Windows XP目标进行编译。
我该如何配置Boost 1.52以使用vc110_xp工具集来构建库?
“Visual Studio 2012 Update 1”支持使用“vc110_xp”工具集来针对Windows XP目标进行编译。
我该如何配置Boost 1.52以使用vc110_xp工具集来构建库?
\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat
,在默认加载后添加行以更改LIB
、INCLUDE
、PATH
和CL
变量。Boost.Build使用此批处理文件,因此您不需要进行其他更改。:x86
部分。:x86
if not exist "%~dp0bin\vcvars32.bat" goto missing
call "%~dp0bin\vcvars32.bat"
set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include;%INCLUDE%
set PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Bin;%PATH%
set LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Lib;%LIB%
set CL=/D_USING_V110_SDK71_;%CL%
goto :SetVisualStudioVersion
有四个set
的补充。对于:amd64
部分也可以进行类似操作,但是我不太愿意发布它,因为我只测试过XP 32位版本,而且我很高兴将目标定在64位构建的Vista+。
请更改boost文件夹中以下文件的内容(已下载和提取)
文件夹:boost_1_54_0\tools\build\v2\tools
文件:
for 32 bit :
toolset.flags msvc LINKFLAGS <user-interface>console : /subsystem:console,5.01 ;
for 64 bit:
toolset.flags msvc LINKFLAGS <user-interface>console : /subsystem:console,5.02 ;
for 32 bit :
toolset.flags('msvc', 'LINKFLAGS', ['<user-interface>console'], ['/subsystem:console,5.01'])
for 64 bit:
toolset.flags('msvc', 'LINKFLAGS', ['<user-interface>console'], ['/subsystem:console,5.02'])
文件夹:boost_1_54_0\tools\build\v2\engine
文件:
for 32 bit/ 64 bit :
1. fix the Visual Studio Path Exactly like instead of "%ProgramFiles%- change
to %ProgramFiles(x86)%
2. Add " /D _USING_V110_SDK71_ " to BOOST_JAM_CC =cl command before Skip_VC11
打开vs2012开发人员命令提示符并键入以下命令
** 根据您的安装更新7.1A SDK路径
call“%ProgramFiles(x86)%\ Microsoft Visual Studio 11.0 \ VC \ bin \ vcvars32.bat”
set INCLUDE =%ProgramFiles(x86)%\ Microsoft SDKs \ Windows \ 7.1A \ Include; %INCLUDE%
set PATH =%ProgramFiles(x86)%\ Microsoft SDKs \ Windows \ 7.1A \ Bin; %PATH%
set LIB =%ProgramFiles(x86)%\ Microsoft SDKs \ Windows \ 7.1A \ Lib; %LIB%
引导
根据操作系统类型选择命令(32/64位)
对于32位:
b2 toolset = msvc-11.0 variant = debug,release link = shared runtime-link = shared address-model = 32
对于64位:
b2 toolset = msvc-11.0 variant = debug,release link = shared runtime-link = shared address-model = 64
要编译任何示例的发行版和调试版本,请按照以下步骤进行:
打开vs2012开发人员命令提示符,然后键入以下命令
运行命令 "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\bin\vcvars32.bat"
设置 INCLUDE 环境变量为 "%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include;%INCLUDE%"
设置 PATH 环境变量为 "%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Bin;%PATH%"
设置 LIB 环境变量为 "%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Lib;%LIB%"
进入示例所在目录,例如:boost_1_54_0\libs\test\tools\console_test_runner
执行以下命令:
<path>\boost_1_54_0\bjam.exe --v2 toolset=msvc-11.0 variant=debug,release link=shared threading=multi runtime-link=shared