Boost logo

Boost-Build :

Subject: Re: [Boost-build] Problems building Boost with clang toolchain and C++11
From: Marshall Clow (mclow.lists_at_[hidden])
Date: 2012-06-20 14:10:54


On Jun 20, 2012, at 11:05 AM, Marshall Clow wrote:
> On Jun 20, 2012, at 10:03 AM, Abe wrote:
>
>> 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:
>>
>>> ./bootstrap.sh -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.
>
>
> Ok. I've looked into this a bit, and it appears to me that the problem is that the "-stdlib=libc++" is not getting passed to the linker, so it's trying to link with libstdc++.
>
> This works for me:
> ../../../b2 toolset=clang cxxflags="-std=c++11 -stdlib=libc++" linkflags="-stdlib=libc++"

I forgot to credit Howard Hinnant, who did some (most?) of the investigation here.
Shame on me.

-- Marshall

Marshall Clow Idio Software <mailto:mclow.lists_at_[hidden]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk