Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build boost with msvc 14.1 ( VS2017 RC)

I am trying to build boost 1.63 with the lastest msvc 14.1 and VS2017 RC. So I did everything I do normally, I opened the Development Cmd and then I run the bootstrap.bat and run the command

b2 -link=static -threading=multi

For some reason I got those errors :

E:/Coding/SDKs/boost_1_63_0/tools/build/src/tools\msvc.jam:834: in generate-setup-cmd
*** argument error
* rule maybe-rewrite-setup ( toolset : setup-script : setup-options : version : rewrite-setup ? )
* called with: ( msvc :  :  : default :  )
* missing argument setup-script
E:/Coding/SDKs/boost_1_63_0/tools/build/src/tools\msvc.jam:746:see definition of rule 'maybe-rewrite-setup' being called
E:/Coding/SDKs/boost_1_63_0/tools/build/src/tools\msvc.jam:1076: in configure-really
E:/Coding/SDKs/boost_1_63_0/tools/build/src/tools\msvc.jam:201: in configure
E:/Coding/SDKs/boost_1_63_0/tools/build/src/tools\msvc.jam:153: in msvc.init
E:/Coding/SDKs/boost_1_63_0/tools/build/src/build\toolset.jam:43: in toolset.using
E:/Coding/SDKs/boost_1_63_0/tools/build/src/build\project.jam:1052: in using
project-config.jam:3: in modules.load
E:/Coding/SDKs/boost_1_63_0/tools/build/src\build-system.jam:249: in load-config
E:/Coding/SDKs/boost_1_63_0/tools/build/src\build-system.jam:412: in load-configuration-files
E:/Coding/SDKs/boost_1_63_0/tools/build/src\build-system.jam:524: in load
E:\Coding\SDKs\boost_1_63_0\tools\build\src/kernel\modules.jam:295: in import
E:\Coding\SDKs\boost_1_63_0\tools\build\src/kernel/bootstrap.jam:139: in boost-build
E:\Coding\SDKs\boost_1_63_0\boost-build.jam:17: in module scope

I am not familar with boost so maybe one of you could give me a hint

like image 734
Artur K. Avatar asked Jan 04 '17 12:01

Artur K.


2 Answers

Based on KindDragons and CPlusPlus OOA and D answers I compiled Boost 1.63. For 64bit. Run "x64 Native Tools Command Prompt for VS 2017" command prompt:

1) Run: bootstrap.bat

2) open project-config.jam. Here is mine:

import option ; 

using msvc : 14.0 : "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\cl.exe"; 

option.set keep-going : false ;

The part: 14.10.25017 keep changing with updates to your Windows SDK. So update it accordingly.

3) Run b2 toolset=msvc-14.0 address-model=64

like image 121
Nick Avatar answered Oct 11 '22 09:10

Nick


Boost 1.63 doesn't fully support VS2017, but you can trick it to find VC++2017 compiler:

  1. Run bootstrap.bat in boost directory
  2. Update the project-config.jam to include: using msvc : 14.0 : <path to x86 or x64 cl.exe>. Should be something like "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.24911\bin\HostX64\x64\cl.exe"
  3. Run "Developer Command Prompt for VS 2017 RC" from Windows Start Menu to boostrap from a shell configured using the x86 vcvars or x64 vcvars.
  4. Run b2 toolset=msvc-14.0 in that command prompt. For the x64 build, add address-model=64 to the b2 command line.

UPDATE: Boost 1.64 should support VS2017

Run "x86 Native Tools Command Prompt for VS 2017" or "x64 Native Tools Command Prompt for VS 2017" from Start Menu, than inside command prompt run b2:

32-bit: b2 toolset=msvc-14.1 --build-dir=.x86 --stagedir=stage_x86

64-bit: b2 toolset=msvc-14.1 address-model=64 --build-dir=.x64 --stagedir=stage_x64

Add link=shared to build shared libraries

like image 44
KindDragon Avatar answered Oct 11 '22 09:10

KindDragon