0

I want to compile a program where I need to build boost library with static linkage, since in Visual Studio 2017 Community I get the following linker error:

LINK : fatal error LNK1104: File "libboost_filesystem-vc140-mt-gd-1_63.lib" could not be opened.

I compiled that already long ago with a different VS version, where it worked.

So, I tried to compile boost 1.63 as discribed on their page. In the VS command prompt, I adopted the arguments from this answer (but just b2 without arguments doesn't work either):

bootstrap
b2 -j8 toolset=msvc-14.1 address-model=32 architecture=x86 link=static threading=multi runtime-link=shared --build-type=complete stage

After the call to b2 I get the following error message in the command window:

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

Question: What is the problem here? How can I build the required libs?

karel
  • 5,489
  • 46
  • 45
  • 50
SampleTime
  • 291
  • 3
  • 19
  • There are already made [Visual Studio binaries](https://sourceforge.net/projects/boost/files/boost-binaries/) here. No need to redo the work that has already been done. – PaulMcKenzie Jun 02 '19 at 11:10
  • @PaulMcKenzie Hm, but only up to mscv-14.0 as far as I can see... Isn't VS 2017 mscv-14.1? – SampleTime Jun 02 '19 at 11:18
  • ok, so the question is -- why are you using such an old version of the library? There was no 14.1 at the time. – PaulMcKenzie Jun 02 '19 at 11:22
  • @PaulMcKenzie Compatibility issues of a legacy software. – SampleTime Jun 02 '19 at 11:23
  • But that shouldn't matter now, since you are using Visual Studio 2017. If your concern was "legacy", shouldn't you also be using a legacy compiler, i.e. VS 2015? – PaulMcKenzie Jun 02 '19 at 11:24
  • @PaulMcKenzie Yes, but I am trying to port it to 2017 while keeping the boost stuff as it was before. – SampleTime Jun 02 '19 at 11:39
  • Do you know what has been changed that you are actually concerned with between 1.63 and a later version that was tested against VS 2017? Be honest now... – PaulMcKenzie Jun 02 '19 at 16:12
  • Also, just to let you know, I regularly update boost versions in my program, and have yet to encounter any issues. – PaulMcKenzie Jun 02 '19 at 16:24
  • @PaulMcKenzie I don't know if anything (important) as been changed... I just would like to understand what is going wrong here. – SampleTime Jun 02 '19 at 16:30

0 Answers0