Re: dynamic linking on mac
Everything's here : linking-the-application-to-qt-as-frameworks.
Hint : list your frameworks in a Makefile variable and do something like:
Code:
for f in $(QT_FRAMEWORKS); do \
ditto -rsrc "$(QTDIR)/lib/$$f.framework" ... ; \
rm debug ... ; \
rm headers ... ; \
install_name_tool -id ... ; \
for g in $(QT_FRAMEWORKS); do \
install_name_tool -change ... ; \
done; \
install_name_tool -change ... ; \
done
Be carefull, you'll have to list the framework in the right order (regarding which frameworks they rely on ...). Use otool -L to know which libraries a framework is linked with.
Example :
Code:
QT_FRAMEWORKS=QtCore QtXml QtNetwork QtGui QtSql Qt3Support QtOpenGL
1 Attachment(s)
Re: dynamic linking on mac
Here's a shell script I created to do all the Mac deployment dirty work for me, including making a dmg image. The usage is quite simple, all it needs is the name of the Qt application. It assumes makefile use (macx-g++ makespec), but it's a simple matter to adjust it to XCode use. It doesn't handle plugins and multiple executables, but that's not too common.
Enjoy.
Re: dynamic linking on mac
Very nice script.
Just be careful with the 'strip' thing: if someone adds plugin support to the script and if the latter take advantage of dynamic lookup, strip will cause lots of problems by removing useful symbols ;-)
This tip may save a lot of time.
Re: dynamic linking on mac
Yes, I know about the problems with plugins and "strip". Unfortunately, the Mac produces HUGE executables (even if they aren't universal).