gpt4 book ai didi

macos - Qt + CMake for OSX bundle : Cocoa Platform Plugin

转载 作者:行者123 更新时间:2023-12-03 17:21:38 25 4
gpt4 key购买 nike

我正在尝试使用 CMake 为基于 Qt 的应用程序制作 bundle 。

就链接而言,事情似乎运行良好,但尝试运行该应用程序却出现错误:

This application failed to start because it could not find or load the Qt platform plugin "cocoa".

Available platform plugins are: cocoa.

我不确定这意味着什么,因为两行输出似乎是冲突的。目录platforms/(包含libqcocoa.dylib)位于MyApp/Contents/Resources/bin/中。请注意,MyApp 可执行文件也在那里。

最佳答案

虽然平台库相对于可执行文件处于正确的位置,但 libqcocoa 库期望它链接到的其他 Qt 库位于特定目录中。我使用带有 install_name_tool -change 命令的脚本来修改这些路径。

关于macos - Qt + CMake for OSX bundle : Cocoa Platform Plugin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24290230/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com