Boost logo

Boost-Build :

Subject: Re: [Boost-build] Problems building Boost with clang toolchain and C++11
From: Abe (abe149_at_[hidden])
Date: 2012-06-20 13:03:51

On Wed, Jun 20, 2012 at 5:19 AM, Jürgen Simon <juergen_simon_at_[hidden]> wrote:

> I'm required to compile Boost with clang on OSX and C++11 support. I have
> used the following commands to  attempt a build:

> ./ -toolchain=clang
>  ./bjam toolset=clang cxxflags="-std=c++0x11stdlib=libc++" threading=multi
> variant=release link=shared runtime-link=shared --layout=system
> --without-mpi --without-python --universal install --prefix=/opt/local

It looks like you have a typo: "-std=c++0x11stdlib=libc++" should
probably be either "-std=c++0x -stdlib=libc++" or "-std=c++11
-stdlib=libc++", depending on compiler version.

For not-very-recent compiler versions [both GCC & Clang], IMO you
should use "-std=c++0x". Recent versions [4.7.x, at least] of GCC
also accept "-std=c++11" -- and this produces exactly the same effect
as "-std=c++0x", AFAIK, except that your build scripts won`t be
backwards-compatible to e.g. GCC 4.5.x.

It seems that the latest release of Clang supports "-std=c++11" too:

Also FYI, even though I don`t recommend it: old-ish versions of GCC
[and maybe Clang too] also support "gnu++0x", which means C++0x with
GNU extensions, and current releases of both compilers support both
that and "gnu++11", which probably means the same thing but might be
closer to the real C++2011 release [rather than using some obsolete
things from the pre-standard C++0x].

I hope the above helps...



Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at