Using Clang with Windows

I have been trying to follow Joshua Boyce’s use of Clang with Windows

http://article.gmane.org/gmane.comp.lib.boost.devel/235708

I can use Ruben's C:/mingw32-dw2 download and compile 'hello world' programs with NetBeans (on Windows), so I think I have the compiler installed OK.

I am now trying to compile the Boost libraries to produce the usual dlls etc using b2/bjam.

In my user-config.jam I have

GCC configuration using the mingw32 version.

using gcc

: 4.7.2

: “c:/mingw32/bin/g++.exe”

;

Clang compiler using mingw32 dw2 Ruben’s release.

using clang

: 3.1

: “C:/mingw32-dw2/bin/clang++.exe”

: -v

-std=“c++11”

-nostdinc # Do not include MSVC C headers.

-nostdinc++ # Do not include MSVC C++ headers.

Use mingw-dw2 for includes

-cxx-include-arch=“C:/mingw32-dw2/i686-w64-mingw32”

-cxx-include-32bit-dir=32

-cxx-include-root=“C:/mingw32-dw2/include/c++/4.6.3”

-stdlib=libc++

#-std=gnu++11

#BOOST_STDLIB_CONFIG=“i:/boost-trunk/boost/config/stdlib/libstdcpp3.hpp”

-stdlib=libc++

;

and the command file add the mingw and /bin to myPATH and contains

b2 -a -d2 -q toolset=clang --build-dir=i:\boost-trunk --build-type=complete stage threading=multi --with-test > build_clang_dll_libs_trunk_test_%date%_%tim%.log 2>&1

In file included from .\boost/detail/fenv.hpp:69:

C:/mingw32-dw2/bin..\lib\clang\3.1/…/…/…/include/c++/4.6.3\fenv.h:57:11: error: no member named ‘fenv_t’ in the global namespace

using ::fenv_t;

~~^

C:/mingw32-dw2/bin..\lib\clang\3.1/…/…/…/include/c++/4.6.3\fenv.h:58:11: error: no member named ‘fexcept_t’ in the global namespace

using ::fexcept_t;

and this is ‘cured’ by adding

-nostdinc # Do not include MSVC C headers.

-nostdinc++ # Do not include MSVC C++ headers.

and adding -stdlib=libc++ reduces the messages considerably,

but I still get

In file included from .\boost/config.hpp:40:

.\boost/config/select_stdlib_config.hpp:18:12: fatal error: ‘cstddef’ file not found

include

^

1 error generated.

The location for includes “C:/mingw32-dw2/include/c++/4.6.3”

which is location of cstddef

but NOT cstddef.h

It contains

#pragma GCC system_header

#include <bits/c++config.h>

#include <stddef.h>

Adding these ‘includes’, or various actual includes doesn’t cure the problem L

-cxx-include-arch=“C:/mingw32-dw2/i686-w64-mingw32”

-cxx-include-32bit-dir=32

-cxx-include-root=“C:/mingw32-dw2/include/c++/4.6.3”

This seems so nearly working (and seems the same as Joshua Boyce has done).

Can anyone help please?

Paul

build_clang_dll_libs_trunk_test_06-Nov-2012_1604.txt (4.26 KB)

You're getting the "file not found" because you told clang not to
search anywhere for includes.

Not sure about the "no member named 'fenv_t' in the global namespace" thing.

-Eli