移植好QT 之后,在开发板中运行程序是,会出以下错误。
qt.qpa.plugin: Could not load the Qt platform plugin "linuxfb" in "" even though it was found.
解决方案: vi /etc/profile 添加 export QT_DEBUG_PLUGINS=1
然后 souce /etc/profile 使配置生效, 加入这句话的意思主要输出插件的调试加载信息
然后运行程序,会输出
QFactoryLoader::QFactoryLoader() checking directory path "/root/nfs/platforms" ...
Cannot load library /usr/lib/qt/plugins/platforms/libqlinuxfb.so: (libudev.so.1: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/usr/lib/qt/plugins/platforms/libqlinuxfb.so" : "Cannot load library /usr/lib/qt/plugins/platforms/libqlinuxfb.so: (libudev.so.1: cannot open shared object file: No such file or directory)"
会发现缺少libudev.so.1 这个共享库文件