"Visual Studio 2012 Update 1" enabled support for a Windows XP target using toolset "vc110_xp".
How do I configure Boost 1.52 to build libraries using the vc110_xp toolset ?
I found the easiest way was to edit \Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat
add lines to change the LIB
, INCLUDE
, PATH
and CL
variables after the defaults were loaded. Boost.Build uses this batch file so you don't need to make any other changes.
For example here is the new :x86
section
: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
Wth the four set
's being the additions. A similar thing can be done for the :amd64
section, though I'm hesitant to post it as I've only tested XP 32bit myself, I've been happy to target Vista+ for 64bit builds.
Change the content of the below files in boost folder( which is downloaded and extracted)
Folder : boost_1_54_0\tools\build\v2\tools
Files:
content changed :
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 ;
content changed :
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'])
Folder : boost_1_54_0\tools\build\v2\engine
Files:
content changed :
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
Open vs2012 developer Command prompt and type the following commands
** update 7.1A SDK path as per your installation
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%
bootstrap
Pick the command as per the OS Type (32/64 bit)
for 32 bit :
b2 toolset=msvc-11.0 variant=debug,release link=shared runtime-link=shared address-model=32
for 64 bit :
b2 toolset=msvc-11.0 variant=debug,release link=shared runtime-link=shared address-model=64
To compile any sample for release and debug versions follow this:
Open vs2012 developer Command prompt and type the following commands
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%
go to the directory of the sample : ex: boost_1_54_0\libs\test\tools\console_test_runner
type the following command
<path>\boost_1_54_0\bjam.exe --v2 toolset=msvc-11.0 variant=debug,release link=shared threading=multi runtime-link=shared
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With