Missing _close$UNIX2003 symbol when deploying Qt 4.7.4 app on Mac OS X 10.4
I am trying to deploy a Qt 4.7.4 application on Mac OS X 10.4 (Intel only) but I get a runtime error when I launch the application
dyld: Symbol not found: _close$UNIX2003
Expected in: /usr/lib/libSystem.B.dylib
I have rebuilt Qt 4.7.4 with '-arch x86 -arch x86_64' on the configure line, which the docs imply will create a universal Cocoa and Carbon application. Using lipo, I have confirmed that my Qt libraries have these two architectures in them.
However, using lipo on my final executable, I only have an i386 version in there and no x86_64 version.
I have tried setting 'QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4' in my .pro files and rebuilding my application, but I still get the same 'Symbol not found' error.
I have not set the Mac SDK to 10.4 because the docs imply that this is only necessary for making universal Intel/PowerPC builds, and I am not targeting PowerPC at all.
I am compiling on Mac OS X 10.6.8 with gcc, and gcc --version says:
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
Are there any steps that I am missing?
What else can I do to help diagnose the problem?
There is no universal Cocoa and Carbon in Qt world. You have either one or the other (depending on the command line switch you feed to the configure script during the build of Qt).
The arch settings you supplied to the Qt library build phase is not automatically applied to applications built with qmake! You will have to add the following line to your .pro file for the app in order to actually build for two architectures:
CONFIG += x86 x86_64
[quote author="Volker" date="1318421919"]There is no universal Cocoa and Carbon in Qt world. You have either one or the other (depending on the command line switch you feed to the configure script during the build of Qt).
I guess I am misunderstanding the docs then, because in 'Developing Qt Applications for Mac OS X' page, the 'Which One Should I Use?' section says I can have 'a 64-bit Cocoa and 32-bit Carbon universal application'. If this is in fact not the case, I'll try reconfiguring my Qt with -carbon, and perhaps log a bug against the documentation.
That aside, I am still not convinced the missing symbol is anything to do with which architecture I am targeting, but more of an SDK issue, but searching Google isn't helping pin it down.
I'll probably report back with success or failure once Qt has rebuilt, which will be a while on my Mac Mini.