Window
1. First install qtcreator(Qt-creator-windows-opensource-2.6.0.exe) is an integrated development environment for Qt. After installation, there is no option for the Qt Gui application. You must install the Qt library to support the creation of Qt applications. (The Qt development environment does not provide the corresponding Library support when installing the development environment like vs, so you must install and configure it manually)
2. Install minGW(MinGW-gcc440_1, extract directly)
[Role of minGW From Baiduzhidao:Like VC, MinGW is a development environment. The development of QT MinGW is because QT is a graphic library in Linux environment, used to develop graphical interface applications, while the development of graphic interface applications in Windows environment does not require QT, but in order not to significantly modify the source code, we need to port QT to Win. (In fact, you can also use VC to develop QT, but you need to re-compile the QT library with the source code, which is not so convenient at the beginning. MinGW is also transplanted from Linux (of course, it is not called MinGW in Linux), so we can use the corresponding compiled QT library directly.]
3. Install qt-win-opensource-4.8.4-mingwTo support the creation of Qt. The installation path of minGW is displayed during installation. Select the path in step 1. After installation, the visual interface development tool of qt design is displayed.
Configure the Qt development environment:
Open Qt Creator, (1 ). tools-> options-> build and run, select "manual settings" in "QT version", and add d: \ Qt \ 4.8.2 \ bin \ qmake.exe installed in step 1;
(2) switch to "(Compilers) tool chain", select "manual settings", and add d: \ Qt \ mingw \ bin \ mingw32-g1_cmd.exe installed in step 1;
Now that the development environment of Qt has been set up, try to write a Qt application.
Linux
1. Download qt-linux version from the official website (http://qt-project.org/downloads), take 4.8.4 as an Example
Qt-everywhere-opensource-src-4.8.4.tar.gz
Qt-creator-linux-x86-opensource-2.7.0.bin (Qt creator)
Ii. 1.Decompress the tar command
Tar zxvf qt-x11-opensource-src-4.4.0.tar.gz
2. Modify the. bash_profile or. profile or/etc/profile file in the directory (you can use the vi editor or gedit) and add the following code:
(Based on the actual directorySet Environment Variables) In linuxProfileThe file is hidden and must be set to be visible.
QTDIR =/usr/local/qt
PATH = $ QTDIR/bin: $ PATH
MANPATH = $ QTDIR/man: $ MANPATH
LD_LIBRARY_PATH = $ QTDIR/lib: $ LD_LIBRARY_PATH
Export qtdir path manpath LD_LIBRARY_PATH
3. log out of the user orSource. bash_profileNext,Make the configuration file take effect
4. Go to the QT directory and start compiling.
./Configure
Enter yes to agree to the GPL/qpl protocol.
5. It takes an hour or two to start making.
Make
6. Start install. It may take about 10 minutes.
Sudo make install
7. Enter the QT directory, enter the bin directory, and then run
./DesignerYou can see the graphic interface.
【Installation ProcessTypical QT error message: "Basic xlib functionality test failed ...
This complete error message is in the./configure stage.
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/zhu/Qt/qt-x11-opensource-src-4.5.2/mkspecs/linux-g ++
The old method should not be changed. IntoConfig. Test/X11/xlib
Run the make command to view the error message.
G ++-Wl,-O1-o xlib. o-L/usr/X11R6/lib-lXext-lX11-lm
/Usr/bin/ld: cannot find-lXext
See it. in/usr/X11R6/lib, The libXext. so cannot be found in g ++.
The reason is the need to install libX11 development kit, in ubuntu/debian package name is libX11-dev
Based on past experience, you can install the following three packages before./configure, which means everything is fine.
Sudo apt-Get install libX11-dev libxext-dev libxtst-Dev
Reference: http://my.oschina.net/uniquejava/blog/108583
]
Reference: http://www.ezloo.com/2008/06/qt_linux_installation.html
III,Qt-creator
1. Modify file attributes and execute mode Permissions
Chmod A + R qt-sdk-linux-x86-opensource-2010.05.1.bin
2./Qt-sdk-linux-x86-opensource-2010.05.1.bin
Install, next, agree ,......
3. Configure QT-creator
Open QT creator, (1). Tools-> options-> build and run, select "manual settings" in "QT version", and thenAdd qmake path
:/Usr/local/trolltech/Qt-4.8.4/bin/qmake;
(2) switch to "(compilers) tool chain", select "manual settings", and selectAdd gcc, And thenAdd g ++ Compiler
/Usr/bin/g ++;
(3) switch to the kits page and add the compilation tool set,For compilers, select GCC of (2) and version name of (1) for QT version..
(Another Installation Method: UseApt-Get---- Never tried
In terminal, enter: sudo apt-Get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos qt4-designer
The qt4-dev-tools includes QT assistant, QT linguist, and QT creator (seemingly not automatically installed in Ubuntu 11)
Qt4-doc this is help documentation
Qt4-qtconfig QT Configuration tool, which is installed by default
Some official demo of qt4-demos
Qt4-designer visual form setup Tool
As mentioned above, QT creator is not installed after installation.
On the Ubuntu graphics desktop, click the Ubuntu Software Center on the left, search for Qt, select QT creator, 22.8 MB, and install it soon.
Refer:Http://blog.csdn.net/berryreload/article/details/7259372
)