Qt找不到平台插件可可 [英] Qt could not find the platform plugin cocoa

查看:454
本文介绍了Qt找不到平台插件可可的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Qt。我已经成功编写了一个小应用程序,可以在Windows 8.1笔记本电脑上正常工作。现在,我安装了XCode和Qt,并将项目文件夹复制到了MacBook。该应用程序可以在Mac上正常编译,但是当我不想通过Qt Creator运行它时,出现以下错误:

I'm experimenting a little bit with Qt. I have successfully written a small app which works fine on my Windows 8.1 Laptop. Now I installed XCode and Qt and copied the project folder to my MacBook. The application compiles fine on my Mac but when I wan't to run it via Qt Creator I'm getting the following errors:

[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. Reinstall application may fix this problem.

我已阅读到工具 macdeployqt 是要将应用程序部署到其他PC时需要。但是,当我直接使用Qt Creator执行应用程序时,我的应用程序是否应该在没有 macdeployqt 的情况下运行?

I have read that the tool macdeployqt is needed when I want to deploy the app to other PCs. But shouldn't my application run without macdeployqt when I execute it directly with the Qt Creator?

使用MacOS X 10.14和Qt 5.11.3。 Xcode 10和MacOSX SDK 10.13已正确安装和设置(至少可以使用此SDK进行编译且没有任何错误)。

I'm using MacOS X 10.14 with Qt 5.11.3. Xcode 10 and the MacOSX SDK 10.13 is installed and setted up correctly (at least it compiles with this SDK and without any error).

有人有想法吗?

推荐答案

几天前,我在官方的Qt论坛上发布了相同的问题,因为在这里我没有得到任何答复Stackoverflow: https:// forum。 qt.io/topic/98816/qt-could-not-find-the-platform-plugin-cocoa

I've posted the same question a few days ago on the official Qt forum, because I haven't got a response here on Stackoverflow: https://forum.qt.io/topic/98816/qt-could-not-find-the-platform-plugin-cocoa

问题似乎在于我已在/ Library / Qt (用户目录外部)上安装了Qt。将Qt重新安装到/ Users / ABC / Qt并完全重建我的项目后,一切似乎都可以正常工作了。

The problem seems to be that I've installed Qt on /Library/Qt (outside of the user directory). After reinstalling Qt to /Users/ABC/Qt and a complete rebuild of my project everything seems to work now.

这篇关于Qt找不到平台插件可可的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆