Compile Qt4.8.2 in Ubuntu12.04: Enter the qt directory./configure-prefix directory (this directory is the installation path after compilation) * This problem occurs: BasicXLibfunctionalitytestfai
Compile Qt4.8.2 in Ubuntu 12.04:
The pure version of Ubuntu does not require g ++ to be installed first.
Sudo apt-get install g ++
Decompress the tar.gz package
Tar zxvf xxx.tar.gz
Enter the qt directory
./Configure-prefix directory (this directory is the installation path after the final compilation)
* This problem occurs:
Basic XLib functionality test failed!
You might need to modify the include and library search paths by editing
QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in/home/gcgily/qt-everywhere-opensource-src-4.8.2/mkspecs/linux-g ++
Three packages are required
Sudo apt-get install libX11-dev libXext-dev libXtst-dev
Then make and make install.
Compile the mysql DRIVER:
Install mysql first
Sudo apt-get install mysql-server
Sudo apt-get install mysql-client
Sudo apt-get install libmysqlclient-dev
Sudo apt-get install emma (it is recommended to install mysql gui, similar to the Front function in windows)
/* Uninstall mysql:
* Sudo apt-get autoremove -- purge mysql-server-5.0
* Sudo apt-get remove mysql-server
* Sudo apt-get remove autoremove mysql-server
* Sudo apt-get remove mysql-common
*/
After installing mysql and the Development Kit, compile the mysql driver.
Find mysql. h and libmysqlclient. so
The files on my computer are under the/usr/include/mysql and/usr/lib/i386-linux-gnu directories respectively.
You need to configure environment variables first.
Export PATH = $ PATH: bin PATH (bin PATH after qt installation,/home/jerry/qt-4.8.2/bin/on my computer /)
Otherwise, qmake cannot be found.
Enter the mysql directory of the compilation package. For example, on my computer, yes ~ /Desktop/qt-everywhere-opensource-src-4.8.2/src/plugins/sqldrivers/mysql
Run the following command:
Qmake-o Makefile export depath + = "/usr/inclue/mysql" LIBS + = "/usr/lib/i386-linux-gnu/libmysqlclient. so" mysql. pro
Then execute make.
You can ~ /Desktop/qt-everywhere-opensource-src-4.8.2/plugins/sqldrivers directory find libqsqlmysql. so
Move libqsqlmysql. so to the plugins/sqldrivers directory under the installation directory. For example, in my computer ~ /Qt-4.8.2/plugins/sqldrivers
Now you can use QMYSQL in your project ~~