Boost logo

Boost :

Subject: [boost] Using Clang compiler in place of GCC
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2015-06-23 07:41:54


I have installed Clang 3.6.1 (along with previously used versions of GCC)

downloaded from LLVM and using the clang for LLVM Windows installer on Windows 8.1

I:\modular-boost\libs\fixed_point\example>clang++ --version
clang version 3.6.1 (tags/RELEASE_361/final)
Target: i686-pc-windows-gnu
Thread model: posix

suggests that I have the compiler in place OK and it should be in my PATH (becos I asked for it to
be).

--debug-configuration

notice: will use 'C:/LLVM/bin/clang++.exe' for clang-linux, condition <toolset>clang-linux-3.6.1

For a project, I have a jamfile starting

project
   : requirements
     <include>../include # quickdox/include
     <include>../../.. # modular-boost root
     #toolset requirements.
     # GCC requirements.
    #<toolset>gcc:<cxxflags>-std=gnu++11 # If requires C++11 library.
    <toolset>gcc:<cxxflags>-Wno-unused-local-typedefs
    <toolset>gcc:<cxxflags>-Wno-missing-braces
    # Clang requirements.
    #<toolset>clang:<cxxflags>-std=c++11 # If requires C++11 library.

(I also have environment BOOST_ROOT = I:\modular-boost)

when I run b2 toolset=gcc

all compiles and run as expected.

when I run b2 toolset=clang

I get messages like

common.mkdir ..\..\..\bin.v2\libs\quickdox\example\quick_auto_dox_index.test\clang-linux-3.6.1
common.mkdir ..\..\..\bin.v2\libs\quickdox\example\quick_auto_dox_index.test\clang-linux-3.6.1\debug

clang-linux.compile.c++.without-pth ..\..\..\bin.v2\libs\quickdox\example\quick_auto_dox_index.test\
clang-linux-3.6.1\debug\quick_auto_dox_index.obj
quick_auto_dox_index.cpp:53:10: fatal error: 'iostream' file not found (or other files like
cstddef, iomanip on other projects)
#include <iostream>
         ^
1 error generated.

  "C:/LLVM/bin/clang++.exe" -c -x c++ -O0 -g -fno-inline -Wall -g -march=i686 -m32 -DBOOST_ALL_NO_L
IB=1 -I"..\..\.." -I"..\include" -o "..\..\..\bin.v2\libs\quickdox\example\quick_auto_dox_index.test
\clang-linux-3.6.1\debug\quick_auto_dox_index.obj" "quick_auto_dox_index.cpp"

(Full log attached).

This suggests that it is not finding the system file <iostream> ...

but I'm puzzled at what is missing (and why).

Suggestions most welcome.

Paul

---
Paul A. Bristow
Prizet Farmhouse
Kendal UK LA8 8AB
+44 (0) 1539 561830



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk