This article describes how to quickly build a Qt development environment under Ubuntu11.10Desktop. My host environment: MacOSX10.7Lion (64bit). The virtual machine environment is VirtualBox4.1.6 + Ubuntu11.10 (32bit ). Because it is operated in a virtual machine, you can use other hosts, such as Windows XP, As long as VirtualBox can be installed and run. VirtualBox currently supports Windows, OSX,
This article describes how to quickly build a Qt development environment under Ubuntu 11.10 Desktop. My host environment: Mac OSX 10.7 Lion (64bit), virtual machine environment: VirtualBox 4.1.6 + Ubuntu 11.10 (32bit ). Because it is operated in a virtual machine, you can use other hosts, such as Windows XP, As long as VirtualBox can be installed and run. VirtualBox currently supports Windows, OSX, Linux, and Solaris. For details, visit [1] on the official website ].
Suppose you already have an available Ubuntu 11.10 Desktop system.
Windows XP hard disk installation Ubuntu 11.10 dual system full graphic http://www.linuxidc.com/Linux/2011-10/46327.htm
1. Preparations
Download QtCreator2.4.0 (latest version, 65 MB ):
Http://qt.nokia.com/downloads/qt-creator-binary-for-linux-x11-32-bit
The latest version of Qt is 4.8.0. If you want to compile or refer to the SDK example, you can download it. This article does not cover this version to save Compilation Time.
2. Installation
2.1 install the Qt SDK
We will install the Qt SDK that comes with Ubuntu, whose version is Qt4.7.4. Under Terminal, run:
$ Sudo apt-get install libqt4-dev
Enter the password as needed.
If you want to use QML, we recommend that you install qmlviewer.
$ Sudo apt-get install qt4-qmlviewer
2.2 install Qt Creator
My QtCreator installer is downloaded to this path:/home/dou/Downloads/qt-creator-linux-x86-opensource-2.4.0.bin. "Dou" in this path is my User Name. Replace it with your own.
Under Terminal, run:
$ Cd ~ /Downloads
$ Chmod + x qt-creator-linux-x86-opensource-2.4.0.bin
$./Qt-creator-linux-x86-opensource-2.4.0.bin
Follow the Wizard to confirm the installation.
3. Configuration
Although Qt SDK is installed first, Qt Creator cannot automatically find the location of Qt SDK in Windows. You need to manually configure this path. Method:
Start QtCreator (a warning message is displayed. For the solution, see Appendix 1.) Open the Tools> Options menu, select Build & Run on the left side of the Options interface, and click the Qt Versions page on the right side. Click "Add…" in the upper right corner ..." To add the Qt SDK. In fact, it is used to find the qmake location. The location of the previously installed qmake is/usr/share/qt4/bin/qmake. In addition, there is a "Details" button below. After expansion, You can compile several auxiliary tools. If compilation fails, restart the system and try again. I compiled OK for the second time.
4. Test
Use the Qt Creator Wizard to create a project for testing. I have created both QWidget-based and QML-based applications, and the compilation and running operations are OK.
[Problem and Solution]
Question 1: The following message is displayed when Qt Creator is started. In fact, this prompt is also prompted when compiling and running the test program.
Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap ",
Solution: Under Terminal, run:
Sudo apt-get install gtk2-engines-pixbuf
Question 2: cannot find g ++.
Solution: Under terminal, run
$ Sudo apt-get install g ++
Question 3: How to uninstall Qt Creator?
Solution: the default path is used when Qt Creator is installed. Run the following command under Terminal:
$ Cd ~ /Qtcreator-2.4.0/bin
$./Uninstall
Refer:
[1] https://www.virtualbox.org/wiki/Downloads
[2] http://qt.nokia.com/downloads/