我有第三部分框架SDL.framework,我从官方网站下载,我在使用这个库时遇到了麻烦。
我已将SDL.framework复制到项目./library文件夹并将其包含如下:
LIBS += -F$$PWD/library -framework SDL
INCLUDEPATH += library/SDL.framework/Headers
它编译得很好但是当我试图运行时,应用程序无法找到这个框架:
dyld: Library not loaded: @rpath/SDL.framework/Versions/A/SDL
Referenced from: /Users/user/Documents/build/project.app/Contents/MacOS/project
Reason: image not found
The program has unexpectedly finished.
我将SDL.framework放到project.app/Contents/Frameworks文件夹中,但应用程序无论如何都没有启动。
似乎lib的路径是正确的:
otool -L project.app/Contents/MacOS/project
project.app/Contents/MacOS/project:
@rpath/SDL.framework/Versions/A/SDL (compatibility version 1.0.0, current version 12.4.0)
@rpath/QtOpenGL.framework/Versions/5/QtOpenGL (compatibility version 5.6.0, current version 5.6.0)
@rpath/QtMultimediaWidgets.framework/Versions/5/QtMultimediaWidgets (compatibility version 5.6.0, current version 5.6.0)
@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.6.0, current version 5.6.0)
@rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.6.0, current version 5.6.0)
@rpath/QtMultimedia.framework/Versions/5/QtMultimedia (compatibility version 5.6.0, current version 5.6.0)
@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.6.0, current version 5.6.0)
@rpath/QtSql.framework/Versions/5/QtSql (compatibility version 5.6.0, current version 5.6.0)
@rpath/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.6.0, current version 5.6.0)
@rpath/QtSerialPort.framework/Versions/5/QtSerialPort (compatibility version 5.6.0, current version 5.6.0)
@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.6.0, current version 5.6.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
哪里有问题?