qtc++11osx-snow-leopardqt5.5

How to deploy Qt 5.5 C++11 application on MacOS X snow leopard (10.6)


My Qt 5.5 application crashed on MacOS X snow leopard (10.6) with next callstack:

0   libc++.1.dylib                 0x6d801002 0x6d801000 + 2
1   org.qt-project.QtCore          0x6c9440ea qRegisterResourceData(int, unsigned char const*, unsigned char const*, unsigned char const*) + 26
2   org.qt-project.QtCore          0x6ca9c577 QXmlUtils::isNCName(QStringRef const&) + 711
3   dyld                           0x8fe0ed69 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 235
4   dyld                           0x8fe0d31a ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int) + 246
5   dyld                           0x8fe0d2be ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int) + 154
6   dyld                           0x8fe0d3cd ImageLoader::runInitializers(ImageLoader::LinkContext const&) + 61
7   dyld                           0x8fe024a9 dyld::initializeMainExecutable() + 134
8   dyld                           0x8fe0794e dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**) + 4189
9   dyld                           0x8fe018b1 dyldbootstrap::start(macho_header const*, int, char const**, long) + 779
10  dyld                           0x8fe01057 _dyld_start + 39

I used open source versions of libc++.dylib and libc++abi.dylib for C++11 support on snow leopard. C++11 applications without Qt dependencies works fine with these libraries.

I can't drop C++11 support from Qt, so this solution is not suitable for me.


Solution

  • As far as I'm aware, this isn't possible. Qt5 was only developed to support Snow Leopard up until 5.3.2, and even then, you had to manually compile 5.3.2 (a binary exists for 5.3.1). I have a binary you can use if you're interested, though no c++11 support. https://github.com/NucleaPeon/qt5-sle/releases/tag/v5.3.2

    This is definitely a Qt5 limitation and from some tickets I was browsing on their tracker on snow leopard issues, they didn't seem keen to fix them for 10.6.8 at the time with newer releases available. You might try compiling your software on OS X 10.7/8/9 with a 10.6 minimum version and see if it runs that way.

    UPDATE I need to change the reason for my answer. While It's true that Qt5 doesn't support C++11 in Qt 5.3.2, Snow Leopard with XCode 4.2 comes with Clang++ 3.0 and GCC 4.2. Experimental GCC C++11 support came during GCC 4.3 and version 3.3 for Clang.

    Sources: https://clang.llvm.org/cxx_status.html https://stackoverflow.com/a/10029817/1703772 https://en.cppreference.com/w/cpp/compiler_support/11