0

我刚刚使用 mac os x 10.12 (Sierra) 和 qt 5.8 for ARM (rasprerry pi) 管理交叉编译。但是,如果我没有遇到任何问题,那就太容易了。我创建了一个非常简单的应用程序,配置环境以从 qt 创建者远程执行它,但是一旦我尝试执行,我仍然遇到错误:

Cannot load library /usr/local/qt5pi/plugins/platforms/libqeglfs.so: (This platform does not support dynamic libraries.)
QLibraryPrivate::loadPlugin failed on "/usr/local/qt5pi/plugins/platforms/libqeglfs.so" : "Cannot load library /usr/local/qt5pi/plugins/platforms/libqeglfs.so: (This platform does not support dynamic libraries.)"
This application failed to start because it could not find or load the Qt platform plugin "eglfs"
in "".

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc.

Reinstalling the application may fix this problem.
Aborted

看起来插件已正确加载:

QT_DEBUG_PLUGINS=1 ./testrpi 
QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqeglfs.so"
Found metadata in lib /usr/local/qt5pi/plugins/platforms/libqeglfs.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "eglfs"
        ]
    },
    "className": "QEglFSIntegrationPlugin",
    "debug": false,
    "version": 329728
}

但我认为这条线解释了一切:

QLibraryPrivate::loadPlugin failed on "/usr/local/qt5pi/plugins/platforms/libqeglfs.so" : "Cannot load library /usr/local/qt5pi/plugins/platforms/libqeglfs.so: (This platform does not support dynamic libraries.)"

现在我的问题是 - “这个平台不支持动态库”是什么意思。我怎样才能让我的应用程序工作?

ldd 显示所有库都存在,strace 永远不会显示以负结果打开。我卡住了,所以任何帮助表示赞赏!

4

1 回答 1

-1

好的问题是在 qtcorelib 的构建中,在文件 qtbase/src/corelib/plugin/qtlibrary_unix.cpp 中,其中标志:

#define QT_NO_DYNAMIC_LIBRARY

被定义并导致所有问题。undef QT_NO_DYNAMIC_LIBRARY解决方案是在此定义和重建 qtcore 库之后执行” 。

问候J

于 2016-12-13T20:13:39.627 回答