Compile and install the latest QT/X11 4.3.4, qtopia 4.3.1, qtopia-core-opensource-src-4.3.3 and usage

Source: Internet
Author: User
First download the source code package for the latest two items on the official website:
Http://trolltech.com/downloads/opensource
Qt-x11-opensource-src-4.3.4.tar.gz
Qtopia-opensource-src-4.3.1.tar.gz
Create a file in/, that is, under the root directory. My name is/azuo.
Put the downloaded package in it and decompress it. Change the name to qt-x11 and qtopia.
Then it is compiled and installed. Now the X11 is compiled and installed, and then the qtopia
Directly write a shell file:
Write Vim A as follows:
! /SH
Qt-x11/CD/azuo/
Echo "yes" |./configure
Make
Make install

Run the shell file.
Open another terminal, write another shell file, and compile qtopia. This compilation is a bit knowledgeable. He requires that the build directory is not the source code directory, so we need to create another directory, my name is myqtopia. Everything is OK. As follows:
Vim B:
Mkdir/azuo/myqtopia
CD/azuo/myqtopia

Echo "yes" | ../qtopia/configure
Make
Make install
Running. The process is very long. We will wait for the result. Haha
Good luck!

After all this is OK, let the system use my latest qt4 instead of the existing qt3.
We to the/usr/lib directory, the qt-3.3 directory to move to their own directory, do not lose, if your own qt4 can not be restored it is
Then go to the installed qt4 system directory. makeinstall will put the required items under the USR directory. The directory on my computer is:
/Usr/local/trolltech/Qt-4.3.4/bin.
Add the/etc/profile file.
Restart
Then try entering the following information in the terminal:
Which designer, assistant, qmake, you can see that all of these are directed to the latest qt4.
Qtopia I just installed it and it is similar

After studying qtopia, add the installation method of qtopia-core:
1.download qtopia-core-opensource-src-4.3.3.tar.gz on the official website
2 decompress and get a folder named qtopia-core-opensource-src-4.3.3
3 CD qtopia-core-opensource-src-4.3.3
4. Generally, qtopia-core is used to compile programs that can run on arm. We compile the program as follows:
./Configure-Embedded ARM -- prefix =/usr/qtopia
Note that larm-Linux-gcc/g ++ is available in the system and can be executed because the installed arm structure is specified.
Here I will say that this arm-Linux-GCC is actually very simple. It is to download the Linux-arm-GCC package and decompress it. g ++ is already included in this package, you can either add arm-Linux-GCC to the system path or create a link to/usr/bin:
Ln-s [dir]/Linux-arm-gcc/usr/bin/ARM-Linux-gcc
Ln-s [dir]/Linux-arm-G ++/usr/bin/ARM-Linux-G ++
5 make
6 make install
7. After the installation is complete, put the qmake that comes with qtopia-core in the system path, but there are already two qmake in my system, so we should change the qmake Name:
Ln-S/usr/qtopia/bin/qmake/usr/bin/Qt-qmake

Check the existence of qmake:
[Root @ btazuo ztzfile] # cd/usr/bin
[Root @ btazuo bin] # ls-L | grep qmake
Lrwxrwxrwx 1 Root 40 03-12 04:16 qtopia-qmake->/azuo/myqtopia/qtopiacore/host/bin/qmake
Lrwxrwxrwx 1 Root 26 03-12 17:11 QT-qmake->/usr/qtopia-core/bin/qmake
We can see that QT-qmake is the qmake of qtopia-core.

Let's take a look at the usage:
First, write a simple QT program:
Hello. cpp:

# Include <qapplication>
# Include <qpushbutton>

Int main (INT argc, char * argv [])
{
Qapplication app (argc, argv );
Qpushbutton Hello ("Hello world! ");
Hello. Resize (100, 30 );
Hello. Show ();

Return app.exe C ();
}

In the path where the file exists:
Qmake-Project
Qmake
Make
To generate an executable file, we can see a graph after execution, because qmake is the qmake of X11.
Below we use a shell program to write a program with an arm structure:
#! /SH
Mkdir/azuo/qhello
CD/azuo/qhello
CP ~ /Hello. cpp ./
Qt-qmake-Project # Use QT-qmake
Qt-qmake
Make
If it succeeds, you can get a qhello object, which is an executable file running on arm and cannot run on your computer.
In this way:
[Root @ btazuo qt_pro] # file qhello
You can see the file format, arm.
Qhello: Elf 32-bit LSB executable, arm, Version 1, dynamically linked (uses SHARED libs), for GNU/Linux 2.4.3, not stripped

OK, so far!

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.