我正在准备发布我的 QT 应用程序。 我有一个导入 -> QtDesktop。
我把它放在 Contents/imports 下(dylib 在 Contents/imports/QtDesktop/plugin 下)。
然后我用 install_name_tool -id & -change 修复了它的依赖关系。
启动应用程序时,它一直说“未安装模块“QtDesktop””
有什么问题吗?
最佳答案
看看这个优秀的 link来自诺基亚 Qt 文档。它们描述了您使用 install_name_tool
提到的步骤。但他们建议将插件放在一个略有不同的文件夹中。
Plugins can be put in the Contents/PlugIns section of a bundle. An advantage of using this location is that the plugins will show up in Finder and users can enable and disable them easily. For a Qt program to take advantage of this feature, we must add this call to main():
qApp->setLibraryPath(qApp->applicationDirPath() + "/../PlugIns");
另请查看聪明的 macdeployqt脚本 - 它会自动为你做所有的事情。我已经在一个应用程序中成功地使用了它。
关于c++ - 在哪里存储用于 OSX 部署的 Qt 导入?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6755375/