Common errors and solutions of Qt development application under Ubuntu

Error: HelloWorld directly report error… :-1: error: cannot find -lGL
Reason: Lack of GL library
Sudo apt-get install libgl1-mesa-dev

I downloaded the latest version of QT-everywhere5.3.1, after porting it to the board directly created a Qt Quick program to run on the board, prompted the following error, can not find the solution online, ask how to solve this problem, thank you.
# ./qmlpng
QEglFSImx6Hooks will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync.
If this is not desired, you can override this via: export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1
QQmlApplicationEngine failed to load component
qrc:///main.qml:1 module “QtQuick” is not installed
qrc:///main.qml:2 module “QtQuick.Controls” is not installed
qrc:///main.qml:1 module “QtQuick” is not installed
qrc:///main.qml:2 module “QtQuick.Controls” is not installed

Qrc :// main. QML :1 module “QtQuick” is not installed. $QTDIR/ QML will be installed in a folder if you install it.

QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
Failed to create OpenGL context for format QsurfaceFormat (version 2.0, options QFlags(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaB

Or try export QML_IMPORT_PATH=$QTDIR/ QML. It is not clear what it is, it may be different from project to project.

Export QML2_IMPORT_PATH=$QTDIR/ QML =$QTDIR/ QML
If this is not desired, you can override this via:
QEglFSImx6Hooks will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync.
If this is not desired, you can override this via: Export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1
=1
=1
=1
=1
=1
=1
=1
=1
=1
=1
=1

The original address: http://www.qtcn.org/bbs/read-htm-tid-56902.html

Read More: