[Interest] rvalue references on Mac OS X 10.10 and XCode 7

Sven Bergner sven.bergner at gmail.com
Sat Sep 26 18:42:37 CEST 2015


2015-09-26 3:18 GMT+02:00 Thiago Macieira <thiago.macieira at intel.com>:

> 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
> > application.
>
> 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.
>
> Thanks Thiago for your advice.
I'll have to check, if we can switch to libc++.

Best regards,
  Sven Bergner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150926/c1fc326a/attachment.html>


More information about the Interest mailing list