[Interest] rvalue references on Mac OS X 10.10 and XCode 7
thiago.macieira at intel.com
Sat Sep 26 03:18:01 CEST 2015
On Saturday 26 September 2015 00:19:22 Philippe wrote:
> > If you have some old library that needs libstdc++, then you're stuck with
> > it for now. That means you must tell your linker not to use libc++, so
> > you need to ensure that the -stdlib=libstdc++ is passed to all steps of
> > the build (compiler and linker). Otherwise you'll get the linker errors
> > you mentioned.
> No, I do use libc++ also.
> And for some reason, I don't have problems linking with libstdc++ *also*.
You can link to the both of them, just as long as each individual Translation
Unit (each .cpp) uses one of them only.
> In my xcode config file, I have both:
> CLANG_CXX_LIBRARY = libc++
> OTHER_LDFLAGS = $SDKROOT/usr/lib/libstdc++.dylib
> I must be doing that for maybe 2 or 3 years.
> > > But __GNUC_LIBSTD__ is not defined, hence Q_COMPILER_RVALUE_REFS is
> > > #defined.
> > It's defined somewhere in libstdc++ headers.
> I don't include any of these headers, hence it's not defined for my
As I said above, that is exactly the point of choosing one of the two for each
.cpp file. You've chosen libc++ for all of your files. Previously, whoever
compiled that static library chose libstdc++ for their files.
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Interest