Reputation: 1
i am trying to run a small project on macOS. for context, i am using clion, c++, and cmake with vcpkg; however, when i run my project, i get this error:
qt.qpa.plugin: Could not find the Qt platform plugin "cocoa" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
examining qt documentation, qt for macOS - deployment | qt 6.8, if my understanding is correct, the libqcocoa.dylib needs to be in macOS bundle. however, this is not the behavior i am seeing when i configure and build the project. the console output when i build in clion shows that the macdeploy executed successfully; nevertheless the necessary dylib is not placed in correct location. i unfortunately don't have a MRE. i have provided a link to my gitlab repo if anyone would like to try and repoduce the error. Draft: Add MacOS Support
i have also tried to set the plugin path QT_PLUGIN_PATH
to the directory containing the dylib. when i do so, i get multiple errors similar to this.
objc[1429]: Class KeyValueObserver is implemented in both /Users/jamalbrown/src/clusterc/.build/app/ccd/ccd.app/Contents/Frameworks/libQt6Core_debug.6.8.0.dylib (0x1120de730) and /Users/jamalbrown/src/clusterc/.build/vcpkg_installed/x64-macos-clusterc/lib/libQt6Core.6.8.0.dylib (0x10defd648). One of the two will be used. Which one is undefined.
as well as.
You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
qt.qpa.plugin: Could not load the Qt platform plugin "cocoa" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: offscreen, minimal, cocoa.
additionally, i apologize if my terminalogy or understanding is completely incorrect. i am trying to improve as a developer. any feedback or documentation would be greatly appreciated.
Upvotes: 0
Views: 62