我正在尝试部署我的QT应用程序,但它无法运行应用程序并获得一组错误。
我尝试使用最初的QWidget应用程序,但没有一行代码更改,并且它也给出了同样的错误。
步骤1:使用QT Creator创建QTWidget应用程序。
第2步:在发布版本文件夹中运行upload.module.chunk.js
。
第3步:运行从控制台创建的应用程序。
我收到以下错误消息。
macdeployqt appname.app
所以,我无法弄清楚我们在这里得到的默认QT应用程序中存在的问题。有没有我缺少的图书馆?
修改:我的QFactoryLoader::QFactoryLoader() checking directory path
"/Users/arqam/Desktop/Junk/build-DMGQtAppTest-Desktop_Qt_5_10_0_clang_64bit-Release/DMGQtAppTest.app/Contents/PlugIns/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/Users/arqam/Desktop/Junk/build-DMGQtAppTest-Desktop_Qt_5_10_0_clang_64bit-Release/DMGQtAppTest.app/Contents/PlugIns/platforms/libqcocoa.dylib"
Found metadata in lib /Users/arqam/Desktop/Junk/build-DMGQtAppTest-Desktop_Qt_5_10_0_clang_64bit-Release/DMGQtAppTest.app/Contents/PlugIns/platforms/libqcocoa.dylib, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"cocoa"
]
},
"className": "QCocoaIntegrationPlugin",
"debug": false,
"version": 329218
}
Got keys from plugin meta data ("cocoa")
QFactoryLoader::QFactoryLoader() checking directory path "/Users/arqam/Desktop/Junk/build-DMGQtAppTest-Desktop_Qt_5_10_0_clang_64bit-Release/DMGQtAppTest.app/Contents/MacOS/platforms" ...
Cannot load library /Users/arqam/Desktop/Junk/build-DMGQtAppTest-Desktop_Qt_5_10_0_clang_64bit-Release/DMGQtAppTest.app/Contents/PlugIns/platforms/libqcocoa.dylib: (dlopen(/Users/arqam/Desktop/Junk/build-DMGQtAppTest-Desktop_Qt_5_10_0_clang_64bit-Release/DMGQtAppTest.app/Contents/PlugIns/platforms/libqcocoa.dylib, 133): Library not loaded: @rpath/libQt5PrintSupport.5.dylib
Referenced from: /Users/arqam/Desktop/Junk/build-DMGQtAppTest-Desktop_Qt_5_10_0_clang_64bit-Release/DMGQtAppTest.app/Contents/PlugIns/platforms/libqcocoa.dylib
Reason: image not found)
QLibraryPrivate::loadPlugin failed on "/Users/arqam/Desktop/Junk/build-DMGQtAppTest-Desktop_Qt_5_10_0_clang_64bit-Release/DMGQtAppTest.app/Contents/PlugIns/platforms/libqcocoa.dylib" : "Cannot load library /Users/arqam/Desktop/Junk/build-DMGQtAppTest-Desktop_Qt_5_10_0_clang_64bit-Release/DMGQtAppTest.app/Contents/PlugIns/platforms/libqcocoa.dylib: (dlopen(/Users/arqam/Desktop/Junk/build-DMGQtAppTest-Desktop_Qt_5_10_0_clang_64bit-Release/DMGQtAppTest.app/Contents/PlugIns/platforms/libqcocoa.dylib, 133): Library not loaded: @rpath/libQt5PrintSupport.5.dylib\n Referenced from: /Users/arqam/Desktop/Junk/build-DMGQtAppTest-Desktop_Qt_5_10_0_clang_64bit-Release/DMGQtAppTest.app/Contents/PlugIns/platforms/libqcocoa.dylib\n Reason: image not found)"
This application failed to start because it could not find or load the Qt platform plugin "cocoa"
in "".
Available platform plugins are: cocoa.
Reinstalling the application may fix this problem.
Abort trap: 6
结果
otool -L
在运行DMGQtAppTest.app/Contents/MacOS/DMGQtAppTest:
@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport
(compatibility version 5.10.0, current version 5.10.0)
@rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.10.0, current version 5.10.0)
@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.10.0, current version 5.10.0)
@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.10.0, current version 5.10.0)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.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 307.5.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.50.2)
时,我得到以下内容:
otool -L libcocoa.dylib
那我哪里错了?