Recently, I have been studying static compiling of Qt. Compared with windows, it is easier to use static compiling of Qt. On the contrary, such errors have been found in articles on linux compilation, here is a brief summary of your compilation results. One experiment environment 1、ubuntu10.0421_qt-x11-opensource-4.7.1.tar.gz 2. The program compilation package is not installed by default after Ubuntu10.04 is installed. Therefore, we must first configure ubunt
Recently, I have been studying static compiling of Qt. Compared with windows, it is easier to use static compiling of Qt. On the contrary, such errors have been found in articles on linux compilation, here is a brief summary of your compilation results.
I. experiment environment
1. Ubuntu 10.04
2、qt-x11-opensource-4.7.1.tar.gz
Ii. Preparations
After Ubuntu 10.04 is installed, no program compilation software package is installed by default. Therefore, we need to configure ubuntu first.
Configuration method: (full root user mode is recommended)
1. First, adjust the network settings so that the machine can access the Internet (the specific practices vary from person to person, which is ignored here)
2. installation package to be configured: Enter the command: apt-get install build-essential libpcap0.8-dev libx11-dev libavahi-gobject-dev libSM-dev libXrender-dev libfontconfig-dev libXext-dev
3. Static compiling Qt
1. Download qt-x11-opensource-4.7.1.tar.gz
2nd release qt-x11-opensource-4.7.1.tar.gz
3. Configure path
Enter the command: export PATH = "$ PATH:/usr/local/Trolltech/Qt-4.7.1/bin"
4. Enter the qt decompression directory and configure the configure command:./configure-static-nomake demos-nomake examples-nomake tools-no-limits tions.
5. Enter "o" and "y" respectively to start the compilation phase.
6. make
7. make install
Wait ......
Iv. Static compiling of Qt Program
1. Create a folder and write the program file XX. cpp.
2. qmake-project
3. Add CONFIG + = static to the pro File
4. qmake
5. After Makefile is generated, insert-static after = of cxxflags
6. make