Qt Mac OS Application deployment missing framework

限于喜欢 提交于 2019-12-23 05:45:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!