[Development] could not find or load the Qt platform plugin "cocoa"

Gil Moses gil at waves.com
Wed Oct 28 15:09:39 CET 2015


Hi,

I've built Mac universal binaries of v5.5.1 (built separately for i386 and x86_64, then used lipo).
Built and ran my Qt app (Xcode 5, Mavericks), and got this error:

. could not find or load the Qt platform plugin "cocoa".

Further diagnosis using DYLD_PRINT_LIBRARIES and QT_DEBUG_PLUGINS prints this when running the app:

==============
<many lines>
QFactoryLoader::QFactoryLoader() checking directory path "/Library/Application Support/Waves/WavesQtLibs_5.5.1/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/Library/Application Support/Waves/WavesQtLibs_5.5.1/plugins/platforms/libqcocoa.dylib"
Found metadata in lib /Library/Application Support/Waves/WavesQtLibs_5.5.1/plugins/platforms/libqcocoa.dylib, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "cocoa"
        ]
    },
    "className": "QCocoaIntegrationPlugin",
    "debug": false,
    "version": 328961
}


Got keys from plugin meta data ("cocoa")
QFactoryLoader::QFactoryLoader() checking directory path "/Volumes/Data/p4client/ProAudio/dev_main/ProAudio/Products/Release/Apps/CODEX App.app/Contents/MacOS/platforms" ...
dyld: loaded: /Library/Application Support/Waves/WavesQtLibs_5.5.1/plugins/platforms/libqcocoa.dylib
dyld: unloaded: /Library/Application Support/Waves/WavesQtLibs_5.5.1/plugins/platforms/libqcocoa.dylib
loaded library "/Library/Application Support/Waves/WavesQtLibs_5.5.1/plugins/platforms/libqcocoa.dylib"
QLibraryPrivate::loadPlugin failed on "/Library/Application Support/Waves/WavesQtLibs_5.5.1/plugins/platforms/libqcocoa.dylib" : "Cannot load library /Library/Application Support/Waves/WavesQtLibs_5.5.1/plugins/platforms/libqcocoa.dylib: (dlopen(/Library/Application Support/Waves/WavesQtLibs_5.5.1/plugins/platforms/libqcocoa.dylib, 5): Library not loaded: @rpath/QtGui.framework/Versions/5/QtGui\n  Referenced from: /Library/Application Support/Waves/WavesQtLibs_5.5.1/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".

Available platform plugins are: cocoa.

Reinstalling the application may fix this problem.
Abort trap: 6

============

I verified that the Qt frameworks (especially the QtGui mentioned in the error) and libqcocoa.dylib are universal i386 & x86_64.

Any ideas?

Thanks, 
Gil Moses
Waves Ltd.



More information about the Development mailing list