3

I would like to build boost 1.59.0 using the Visual Studio 2015 (Community). I followed the documentation and this question. Specifically, I did:

  1. Download boost 1.59.0 from http://www.boost.org/
  2. Extract files (e.g. “C:\some_dir\boost_1_59_0”)
  3. Open VS2015 x64 Native Tools Command prompt.
  4. check compiler version with where cl with result C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe
  5. change into directory boost_1_59_0
  6. call bootstrap.bat no errors are reported
  7. call b2 toolset=msvc-14.0 address-model=64 --with-python as part of the output it will happily report - 32 bit: yes

When I try to build libs\python\example\tutorial it again reports - 32 bit: yes and results in the error python34.lib(python34.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'. I interpret this as: the python dll is x64 (as installed) but my target is 32 bit.

Any hints would be greatly appreciated.

Community
  • 1
  • 1
Peter
  • 543
  • 1
  • 5
  • 13
  • 3
    Ahh yes I see the problem: MSVC. – Nooble Sep 12 '15 at 22:41
  • Try to delete cached files: `b2_msvc_14.0_vcvarsall_x86.cmd`, `b2_msvc_14.0_vcvarsall_x86_amd64.cmd`, `b2_msvc_14.0_vcvarsall_x86_arm.cmd` from `C:\Users\\AppData\Local\Temp` and rebuild boost. – doqtor Sep 13 '15 at 10:02
  • This might seem trivial, but did you also specify `address-model=64` when building `libs\python\example\tutorial`? – bogdan Sep 13 '15 at 10:30
  • I tried once more deleting the cached files and also specifying `address-model=64` when building the tutorial. However, it stubbornly says ` - 32 bit: yes`. In addition I tried using mingw-64. With mingw-64 everything compiles fine in 64 bit. However, when the build process tries to run python, or I run the python example, python crashes. But that would be a different question. – Peter Sep 13 '15 at 18:27
  • Confusing as it is, `32 bit: yes` doesn't mean it's actually doing a 32-bit build; it only indicates what the default configuration would be if you didn't specify an `address-model`. Some info [here](http://boost.2283326.n4.nabble.com/boost-config-context-log-1-58-address-model-and-architecture-detection-td4674125.html#a4674135). Look at the library output paths in `bin.v2`: if you have some `address-model-64` directories in there, then it's most likely building for 64-bit. – bogdan Sep 13 '15 at 22:05
  • Please check if BlueGo can build boost for you: https://bitbucket.org/Vertexwahn/bluego/src/default/ – Vertexwahn May 14 '19 at 19:26

1 Answers1

0

At first run VS2015 x86 Native Tools Command Prompt item in START menu as Administrator and go to the boost library in cmd.

Now do the following steps :

  1. bootstrap
  2. b2 variant=debug,release link=static runtime-link=static address-model=64 toolset=msvc-14.0