Linux Redhat 9 unzip ", download it to Linux and decompress it. In XWindow, right-click" Unzip ..", Haha, I am too lazy to think about the annoying commands in Linux. Before that, you 'd better do some work first, or the compilation below will go wrong.
Open a terminal and enter:
- Ln-S/usr/Kerberos/include/com_err.h/usr/include/
- Ln-S/usr/Kerberos/include/profile. h/usr/include/
- Ln-S/usr/Kerberos/include/krb5.h/usr/include/
It is set in this system. Otherwise, an error about "krb5.h" will be reported during compilation.
For other QT versions, for example, “qt-x11-opensource-src-4.4.3.tar.gz ", you also need to modify some files in it. It will report an error" 'readrgbaimageoriented' undeclared ". The modification method is to open qinihandler. CPP transfers the encoded readrgbaimageoriented (TIFF, width, height, reinterpret_cast <uint32 *> (partial image. BITs (), orientation_topleft, 0)
When readrgbaimage (TIFF, width, height, reinterpret_cast <uint32 *> (when image. BITs (), 0), because usr/include/Rewrite IO in RedHat 9. h does not have the previous function.
Compile and install oracle at the beginning. Just wait.
In the terminal, CD to the decompressed file, and then enter:
- ./Configure
- Gmake
- Gmake install
The entire process takes more than two hours.
After the installation, the following interface appears, right, It installs the default path is:/usr/local/trolltech/Under the Qt-4.3.4
Configure the environment variables of qt4 as follows:
- // Open the/etc/profile file and add the following statement at the end of the file:
- Path =/usr/local/trolltech/Qt-4.3.4/bin: $ path
- Qtdir =/usr/local/trolltech/Qt-4.3.4
- Manpath = $ qtdir/MAN: $ manpath
- LD_LIBRARY_PATH = $ qtdir/lib: $ LD_LIBRARY_PATH
- Export path qtdir manpath LD_LIBRARY_PATH
Qt3 is enabled by default. Now let's modify the associated file that starts qt3 under "/usr/bin" and find "designer ", we found that this file really links the execution file of qt3. It is clear that the designer is a link and points to the designer of qt3 through the designer. Now we want the designer to be the designer of qt4 by default, you only need to redirect the link. Similarly, if you want qmake to use qt4 by default, you only need to redirect the link.
- Sudo RM/usr/bin/designer
- Sudo ln-S/usr/local/trolltech/Qt-4.3.4/bin/DESIGNER/usr/bin/designer
- Sudo RM/usr/bin/qmake
- Sudo ln-S/usr/local/trolltech/Qt-4.3.4/bin/qmake/usr/bin/qmake
I suggest you change the link to the execution file under "/usr/local/trolltech/Qt-4.3.4. In this way, you can thoroughly use qt4.
The default font of qt4 will contain garbled characters. Let's set it. Open qtconfig and select "forts". The other settings remain unchanged.
Open qdesigner to display our long-awaited qt4 Interface
Next we will install and debug the compilation environment. Here we will not select the kdevelop series. I think it is quite annoying to install it. The first redhat9 comes with QT 3.1.1, to install kdevelop3.5 (you can debug the qt4 Program), you must upgrade the QT version of the system to version 3.3, which is not exhausting, so here I will use the lightweight qdevelop0.26. The reason why I say it is lightweight is that it is "installed" (only need to compile (it must be qt4.3.x) and then use its execution file) time is short.
Download “qdevelop-0.25.2.tar.gz "and decompress it. You only need qmake qdevelop. pro to make it again. This process takes about 10 minutes.
If the following error occurs during compilation:
- Src/initcompletion. cpp: In destructor 'virtual
- Initcompletion ::~ Initcompletion ()':
- Src/initcompletion. cpp: 52: Parse error before '+ 'token
- Src/initcompletion. cpp: 53: Confused by earlier errors, bailing out
- Make: *** [Build/O/Unix/initcompletion. O] Error 1
You only need to modify the initcompletion. cpp file in the src directory:
- // Original file
- Initcompletion ::~ Initcompletion ()
- {
- Qstringlist list = qdir (qdir: temppath (). entrylist (qstringlist () <"qdevelop-completion-*", qdir: files );
- Foreach (qstring file, list)
- {
- Qfile (qdir: temppath () + "/" + file). Remove ();
- }
- ........................
- }
- // Modify as follows:
- Initcompletion ::~ Initcompletion ()
- {
- Qstringlist list = qdir (qdir: temppath (). entrylist (qstringlist () <"qdevelop-completion-*", qdir: files );
- Foreach (qstring file, list)
- {
- Qstring STR = qdir: temppath () + "/";
- Qfile (STR + file). Remove ();
- }
- ........................
- }
After compilation, you can run and use it.
Let's create a new project, first feel:
The disadvantage of qdevelop is that it cannot display Chinese characters normally, so I had to write it elsewhere and paste it.
Compile and run:
Next we will give the program a home on the desktop:
In this way, it can be developed in windows. Increased development efficiency.