注意必须好好看官方文档:
http://qt-project.org/doc/qt-5/linux.html
包括编译Qt库依赖的包等等。
编译过程中发现以下错误:
All the OpenGL functionality tests failed!
You might need to modify the include and library search paths by editing
QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL
因为我在./configure的时候传递了-opengl的参数,而qt的gl模块我必须用到,不能取消这个参数躲过这个问题,而好好看了下文档,才解决的。它依赖于gl的开发包才能编译这个gl模块了。
以下链接给出了解释:
http://www.qtcentre.org/threads/17926-configure-Qt-with-opengl-on-Ubuntu-8-10
我开始没确定我的ubuntu 12.04有没有libgl1-mesa-dev 和libglu1-mesa-dev这两个gl的开发包,所以直接在源中搜索了一下
sudo apt-cache search libgl | grep dev
果然有,然后apt-get install 这两个包就行了,然后再configure,上面的错误就消失了。