注意,我这里没有做功能裁剪,如果有些功能用不上,可以在这里配置,不进行编译(比如 -skip xx , -no xx),对configure文件的配置具体说明见这里
注意,如果是要做Qt Quick项目,那一定要加上 -xcb, 编译quick项目是需要依赖这个玩意儿,网上很多在这里设置编译配置是直接把xcb去掉不进行编译, 由于我也是第一次弄这个玩意儿,所以走了很多弯路。如果不编译xcb就会报错,qt.qpa.plugin: Could not find the Qt platform plugin “xcb” in ""
开始编译
先修改一下配置文件的权限:
chmod 777 autoConfigure.sh
1
运行脚本
sudo ./autoConfigure.sh
1
执行configure可能会遇到的问题
ERROR: Feature 'xcb' was enabled, but the pre-condition 'features.thread && libs.xcb && tests.xcb_syslibs && features.xkbcommon-x11' failed.
ERROR: Feature 'opengl' was enabled, but the pre-condition 'features.opengl-desktop || features.opengl-dynamic || features.opengles2' failed.
ERROR: The OpenGL functionality tests failed!
You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2],
QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.
ERROR: Feature 'alsa' was enabled, but the pre-condition 'config.unix && !config.qnx && libs.alsa' failed.
ERROR: Feature 'gstreamer_1_0' was enabled, but the pre-condition 'libs.gstreamer_1_0' failed.
ERROR: Feature 'pulseaudio' was enabled, but the pre-condition 'libs.pulseaudio' failed.
sudo make install
1
编译中遇到的问题
我在编译的时候出现过一个错误,实在location模块中,错误如下:
提示:error: ‘program’ was not declared in this scope program()->setUniformValue(m_color_id,v); …
一大堆这种类似错误,原本我打算通过配置configure使其编译的时候跳过这个模块,但是没啥用,后来干脆直接把源码下面这个location目录删了,这个问题就搞定咯,反正我项目里面不需要用到location模块。