Qt 6.4.0 Static Build on OSX fails loading cocoa plugin OSX 12.6
-
Hi,
I needed to do a static build of Qt 6.4 because my app uses custom allocators and de-allocators.
So I configured Qt as follows:
./configure -cmake-generator 'Unix Makefiles' -debug -skip qt3d -skip qtlocation -nomake examples -nomake tests -skip qtwebengine -skip qtwebview -skip qtcharts -skip qtdatavis3d -skip qtwebsockets -skip qthttpserver -skip qtserialport -skip qtquick3d -skip qtquick3dphysics -skip qtremoteobjects -skip qtserialbus -skip qtspeech -skip qttranslations -skip qtvirtualkeyboard -skip qtwebchannel -skip qtwayland -skip qtpositioning -skip qtsensors -no-harfbuzz -skip qtconnectivity -skip qtwebserver -skip qtwebsockets -skip qtlottie -skip qtdoc -skip qt3d -qpa cocoa --prefix=/usr/local/Qt6.4.0 -staticThis worked well, but this fails during execution:
[qt.qpa.plugin] Could not find the Qt platform plugin "cocoa" in "/usr/local/Qt6.4.0/plugins/platforms/"
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.If I look in /usr/local/Qt6.4.0/plugins/platforms/, I find:
libqcocoa_debug.a libqcocoa_debug.prl libqminimal_debug.a libqminimal_debug.prl libqoffscreen_debug.a libqoffscreen_debug.prl objects-Debug
So it looks like there's a static version of the plugin, but I can't figure out how to use it instead of dynamically loaded one.
I tried just linking libqcocoa_debug.a into my app, but that didn't help.
I also tried using Q_IMPORT_PLUGIN(qcocoa); but that didn't work either.
Does anyone have any ideas?