QT:could not find or load the Qt platform plugin "

2019-07-12 23:38发布

class="markdown_views prism-github-gist">

简介

嵌入式linux中运行qt程序提示下面的错误,
This application failed to start because it could not find or load the Qt platform plugin “linuxfb”
in “/usr/plugins/”.
原因是程序找不多linuxfb这个插件,配置下插件的查找路径就可以了

解决办法

export QTDIR=/usr export QT_QPA_FONTDIR=$QTDIR/lib/fonts export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/plugins/ export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:size=800x600:mmSize=800x600:offset=0x0:tty=/dev/tty1 QT_QPA_PLATFORM_PLUGIN_PATH设置为Qt plugins的真实路径

引用

http://blog.csdn.net/braveyly/article/details/14005191
http://www.cnblogs.com/tracing/p/4982296.html