Static compilation of Qt-4.7.1 in Ubuntu

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.