Compiling software with c++11 support

William Gallafent william at gallaf.net
Thu Sep 12 02:59:59 PDT 2013


On 12 September 2013 05:11, Jeremy Huddleston Sequoia
<jeremyhu at macports.org> wrote:
> Yes, indeed it should.  An app compiled with lang=c++11 can link against a library compilerd with lang=c++89 and using stdlib=libc++.  The runtime library is the key point here (not the language version).  The use of libc++ (or a newer libstdc++) enables support for C++11 features in the relevant compilers.

Aha. That's the bit I hadn't grokked. I had /thought/ that the
following case would /not/ work:

Project A built with std=c++11, Project B built with std=c++03, … A
links to B … A passes a string (or some other STL type) constructed in
“C++11-world” to B, which then works on it in “C++03-world”.

This thread, and further reading, suggests that this /will/ work fine,
provided the runtime linked by both A and B supports C++11 … :)

-- 
Bill Gallafent.


More information about the macports-users mailing list