Experience in installing Qt5.2.0 in ubuntu12.04 [Lenovo b470virtualbox]

Source: Internet
Author: User
Conclusion [Lenovo b470virtualbox] -- General Linux technology-Linux programming and kernel information: See the following for details. My machine is Lenovo B470, pre-installed with win7. To learn programming in linux, virtualbox is installed. Although vmware is powerful, it is still difficult to find the key, so I installed the open-source virtualbox to run ubuntu. We recommend that you use this virtual machine, because virtualbox is now very powerful, supports file sharing between my ubuntu aircraft (guest and Windows 7 host (host) systems, two-way copy and paste, 3D acceleration is supported. of course, additional enhancement kits need to be installed for these features. As a beginner, after several days, the installation was successful. In retrospect, although I have made many low-level mistakes, I have learned a lot of knowledge, so I am very happy. The following describes the installation process and problems that should be paid attention to during installation.
The installation process is divided into four parts. First, install the virtualbox virtual machine. second, install ubuntu12.04 in virtualbox. after successful installation, download and install the birtualbox enhanced toolkit. third, install g ++, make configuration preparations for Qt installation. then you can start the installation of Qt. The procedure is as follows:
The first part is the installation of the virtual machine virtualbox. You can download the installation package and Extension pack from the official virtualbox website. The installation process is still relatively simple. you need to be reminded to slow down the next step during installation. Because it is installed on drive C by default in windows, you must change the installation path during the installation process. Otherwise, your drive C won't be enough. Because the installation process is prompted in English and the font is small, the virtual machine is often installed on the C drive accidentally. For detailed installation steps, please search Baidu. After installing the virtual machine, double-click the enhanced toolkit to install it. After installation, open virtualbox and create a linux-type guest plane. Do not worry about installing the system after the aircraft is built, because Qt5.2.0 must support 3D acceleration. Therefore, first open the settings (double-click the toolbar on the page displayed after birtualbox) --> Display, and then select the enable 3D acceleration option, and set the memory size (I recommend that the memory size be no less than 128 MB. if the default 4.5 MB is used, the installation cannot be completed and the installation is suspended when the additional driver is installed ).
The second part is to install ubuntu12.04 in virtualbox. At the beginning, I thought ubuntu13.10 was more powerful and should be more stable than 12.04. However, after ubuntu13.10 is installed, you may not be able to log on to the system on the desktop, or you may not be able to display the control bar and system settings charts after entering the desktop environment. Searching for information on the Internet may result in a problem with the video card driver settings. Because my graphics card is a dual-card nvidia graphics card + intel integrated graphics card. Another possibility is that, because the 3D acceleration feature of virtualbox is not enabled, and ubuntu13.10 is just a 3D desktop (I will test this method tomorrow ). 12.04 The installation process is not described in detail. there is a lot of information in this regard. please continue Baidu search.
The third part is preparations before installation. Qt must use GCC for C ++ programming and development. Therefore, if your system does not have GCC and g ++ (GCC c ++ compiler), you must first install them. Ubuntu12.04 provides GCC by default, but does not provide C ++ compiler g ++. At this point, you may ask, "Why don't you install apt-get directly? That's simple and convenient ." The reason is very simple. At present, Qt5.2.0 does not provide such installation sources ., Therefore, you must first install g ++ with the following command:
$ Sudo apt-get install g ++
Then install other dependent libraries (I guess it is the opengl library interface of Qt Programming. if it is not installed, the Qt demo cannot be compiled, and the error GL/gl. h: No such file is prompted)
$ Sudo apt-get install build-essential
Install libgl1
$ Sudo apt-get install libgl1-mesa-dev
Note: As I was a very bold newbie, I started to install Qt5.2.0 directly after installing g ++. After the installation is successful, the clock demo cannot be compiled and the error "GL/gl. h: No such file" is prompted ". Later, refer to the 2012nd Cainiao Post "ubuntu 12.04 problem solving note set (1)-Automatic mounting to windows partition-GL/gl appears on the QT instance. h: No such file error "to remedy this problem can also be solved. The command is as follows:
$ Sudo apt-get install build-essential debian-keyring freeglut3-dev
Part 4 install Qt5.2.0. first download the installation package from the official website. My system is 32-bit ubuntu12.04, so I downloaded the qt-linux-opensource-5.2.0-x86-offline.run package. Download the corresponding installation package according to your system configuration. Enter the folder where the installation package is located and run the following command:
$./Qt-linux-opensource-5.2.0-x86-offline.run #./installation package name, please replace "installation package name" with the name of the installation package you downloaded"
The installation interface is now familiar to everyone in windows. After the installation is complete, open the Qt welcome page and select the example (examples) to search for the clock and double-click the demo to verify that qt works properly. Then select build. if qt works properly, a small clock interface will pop up. So far, Qt has been installed.


Note: I am writing it here today. I will continue to introduce how to quickly open Qtcreator.

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.