In order to use Qt under Linux, you need to install G++ environment before installing Qt. After installation, you need to set environment variables. You only need to complete the Qt development environment in seven steps. The following small series will give you details. Introduce how to build a Qt environment under Linux, let's learn together.
a, G ++ installation environment
sudo apt-get install build-essential
some additional relevant environment. If not installed, some qt components can not be compiled properly, such as openGL
sudo apt-get install libx11-dev libxau-dev libxaw7-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp- Dev
sudo apt-get install libxext-dev libxfixes-dev libxfont-dev libxft-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev
sudo apt-get install Libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev
sudo apt-get install libglib2.0-dev
sudo Apt-get install libssl-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libcups2-dev
sudo apt-get install libgl1- Mesa-dev libglu1-mesa-dev
sudo apt-get install libgstreamer0.10-dev
Second, extract the code
tar zxvf qt-everywhere-opensource-src- 4.8.4.tar.gz
After decompressing and entering the decompressed source code folder
3. Execute. /configure generates makefile
. /configure -prefix /usr/local/Qt-4.8.2
(The directory /usr/local/Qt-4.8.2 specified above is the installation directory after make install)
The following dialog box appears to select open source edition. This is a free version. Enter yes to accept the agreement.
(1) If your machine's various library files are complete, after a short while, the configuration is complete, the following information will appear
Qt is now configured for building , just run ‘make’
Once everything is built , you must run ‘make install’
Qt will be installed into /usr/local/Qt-4.8.2
To reconfigure ,run ‘make confclean’ and ‘configure’
Description Makefile file generated successfully
(2) If the following message appears
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.4/mkspecs/linux- g++
It’s still the old way, so it’s always changing. Go to config.test/x11/xlib and execute the make command to see the error message
g++ -Wl,-O1 -o xlib xlib.o -L/usr/X11R6/lib -lXext -lX11 -lm
/usr/bin/ld: can't find -lXext
See it, g++ in /usr/X11R6/lib, can't find libXext.so.
The reason is that you need to install the development package of libX11. The package name in Ubuntu/debian is libX11-dev
Based on past experience. Proactively install the following 3 packages before /configure, basically everything is fine.
sudo apt-get install libX11-dev libXext-dev libXtst-dev
Install the required package and then re-install . /configure can generate Makefile
If it appears: Project ERROR: Package gstreamer-app-0.10 not found, execute the following command
apt-get install libgstreamer0.10-dev libgstreamer-plugins -base0.10-dev if it appears: g++: error: unrecognized command line option ‘-fuse-ld=gold’
This is a bug in Qt: https://bugs.webkit.org/show_bug .cgi? Id=89312
In a system with a gold linker, the compile script will add the -fuse-ld=gold option, but this option gcc is not supported. The solution is to remove this option, find the file src/3rdparty/webkit/Source/common.pri, and mask QMAKE_LFLAGS+=-fuse-ld=gold.
#
QMAKE_LFLAGS+=-fuse-ld=gold
Previous12Next Total 2 Pages
Computer operating systems generally have their own screenshot shortcuts, and many
PlayOnLinux is a very good software for friends who like Windows software but use L
In the Linux system using awk text processing tools, sometimes need to merge multip
LVM partitions are generally found in U disk, Linux systems access these partitions
CentOS 6.0 manual upgrade to CentOS 6.2 method
How to sniff HTTP traffic under Linux
Summary of methods for restricting user su-permissions in Linux system
How to use dd command in Linux system
What should I do if I want to enter a password every time git is submitted in Ubuntu?
Summary of tar commands in Linux system
RedHat 6 uses xrdp to log in to Windows Remote Desktop
How to modify the default timeout time of sudo in Ubuntu system?
Linux how to use the Xsnow command to display the snow effect on the desktop
After the Linux boot, the terminal prompts -bash-2.05b$ What should I do?
Installing Linux mint graphic tutorial with U disk under Windows
How to make Red Flag Linux use wireless network card to be more secure
Win10 Mobile Preview 10166 Quick Start Demo
Use Win 7 search function faster and more accurate
Set up simple themes for Win7 systems to improve operational efficiency
Creating a Windows 7 notebook from the power improvement start
Three steps for disk partitioning in Win8 system
System Daquan share: notebook computer 2012 latest graphics card ranking
Win7 can not install Thunder how to solve?
Prompt for Solution 1868 when installing Ghost Win8