0

I am trying to build Boost 1_74_0 for Clang on Windows 7. I go to the folder with bootstrap etc and run:

bootstrap --with-toolset=clang-win

but I get:

Building Boost.build engine
Failed to build Boost.build engine

and the log says:

Found with vswhere Visual Studio Locator version 2.5.2+gebb9f26a3d
###
### "Unknown toolset: vcunk"
###
### You can specify the toolset as the argument, i.e.:
###     .\build.bat msvc
###
### Toolsets supported by this script are: borland, como, gcc,
###     gcc-nocygwin, intel-win32, metrowerks, mingw,
###     vc11, vc12, vc14, vc141, vc142

I did add my Clang bin folder to my PATH env variable.

How should I resolve this?

user997112
  • 29,025
  • 43
  • 182
  • 361

1 Answers1

2

I assume that your version of clang was installed with VS2019 from your previous question.

Therefore, you need to issue the commands from a Developer Command Prompt for VS 2019. Since you've already added the Clang bin folder to your PATH env variable, the following should work for you:

bootstrap.bat --with-toolset=clang-win

b2 toolset=clang-win link=shared threading=multi --build-type=complete stage

Note: this builds 32 bit boost library binaries.

The following command should build 64 bit boost library binaries:

b2 toolset=clang-win address-model=64 link=shared threading=multi --build-type=complete stage

However, it only builds the exception and test_exec_monitor binaries.
The other binaries, including date_time, report linker errors.

kenba
  • 4,303
  • 1
  • 23
  • 40
  • Hi again, I'm actually running both VS2019 (as you know from my other Q) and Netbeans. On this occasion I installed LLVM manually and pointed Netbeans to these binaries. This built fine but I get the same Boost linker error as I got with VS2019. So I understand your answer will fix VS2019, but may I ask how I also build the Boost libraries for Netbeans too? I didn't realise how the Boost libraries being built is specific to VS2019 environment. – user997112 Jun 18 '20 at 15:46
  • I use VS2019 & Qt Creator, not Netbeans. The clang boost libraries should be the same regardless of the build environment. You'll need to ask another question if you want to know how to build the clang boost libraries with Netbeans. – kenba Jun 19 '20 at 06:57
  • Your last two sentences seem to contradict each other. If the Clang boost libraries are the same regardless of IDE, why would I need to ask another question about Netbeans? I think the problem is the Boost build is detecting VS? I have replaced the clang argument with gcc and i get the same error. – user997112 Jun 20 '20 at 02:35
  • My last two sentences do not contradict each other if you read them carefully. Link errors are usually due to PATH errors, either the directory containing the libraries is not on the library path or the libraries do not exist – kenba Jun 20 '20 at 07:53
  • I read them carefully: "if you want to know how to build the clang boost libraries with Netbeans." Building has nothing to do with Netbeans. After the libs are built you configure the IDE lib paths. My libs do not exist. I am trying to install Boost build and VS seems to be getting detected, regardless whether I use "--with-toolset=clang-win" or "--with-toolset=gcc" – user997112 Jun 20 '20 at 19:48