问题
I use Qt and macdeployqt to deploy my C++ app.
It include OpenGL and Qt Frameworks in the bundle app but miss some others (ie : SDL) and the app doesn't work on others system if the SDL framework is absent. Here's my pro file
QT += core
QT += xml
QT += opengl
QT += gui
TARGET = StripTest
CONFIG += console
TEMPLATE = app
#Main app
SOURCES += main.cpp \
StripWindow.cpp \
MainWindow.cpp \
HEADERS += StripWindow.h \
MainWindow.h\
#Graphics
SOURCES += \
../../libs/PhGraphic/SDLMain.cpp \
INCLUDEPATH += ../../libs \
/Library/Frameworks/ \
LIBS += -framework SDL -framework SDL_image -framework SDL_ttf
Should-I compile frameworks too?
Edit : the problem isn't solved if I copy the framework manually on the bundle. It has to be present on /Library/Frameworks/
回答1:
macdeployqt will only copy and fix up the required Qt Frameworks to your application.
If you run "otool -L" on your application's executable (in the Contents/MacOS folder of the bundle), you'll see where the library frameworks are being referenced from.
Other libraries than those from Qt, listed in the .pro file, will need you to copy them in to the Frameworks folder of the application bundle and then run the command install_name_tool to update the paths of where the application references them.
I suggest you create a batch script for this, to run as a post-process event when compiling Qt OSX apps.
来源:https://stackoverflow.com/questions/17149796/qt-mac-os-application-deployment-missing-framework