Linux Mint (Application: QT 5.X compilation error)

Source: Internet
Author: User
Tags linux mint

We've described how to install QT before, and you can use it to write a QT program when you're done installing it. Using QT to write a program is as good as ever, but when compiling the QT program encountered a compilation error. Prompt when we compile a well-written QT application “cannot find -lGL” . The following is an error:

The error is that the OpenGL library is missing from the link, which means that there is a lack of OpenGL libraries in our system. However, we can use QT to create standard C programs, when the compiler does not produce errors, because the standard C program does not use the OpenGL graphics library.

Since the lack of the OpenGL graphics Library has caused a compilation error, we can fix the error by installing the library in the system, but OpenGL is a commercial software, and we can use the Open source repository with the same functionality as it does: Mesa. The following are the specific installation procedures:

Root# Apt-get Install Libgl1-mesa-dev//Use this command to mount the libraryReading Package List...Completing the dependency tree that is analyzing the package is reading state information...Complete the following packages are installed automatically and do not need it now: g++ g++-4.8libstdc++-4.8-devuse' Apt-get autoremove 'To remove them. The following "new" packages will be installed: Libgl1-mesa-dev upgraded0A new package, a newly installed1A package to uninstall0Packages that have581Packages have not been upgraded. Need to download5,258B's package. will be consumed after decompression95.2KB of extra space. Get:1Http://archive.ubuntu.com/ubuntu/trusty-updates/main Libgl1-mesa-dev i38610.1. 3-0ubuntu0.6 [5,258B] Download5,258B, Time consuming1Seconds4,972b/s) Selecting previously unselected package Libgl1-mesa-dev. (Reading Database...The system is currently installed a total of162364Files and directories. ) Preparing to unpack.../libgl1-mesa-dev_10.1.3-0ubuntu0.6_i386.deb...Unpacking Libgl1-mesa-dev (10.1. 3-0ubuntu0.6)...Setting Libgl1-mesa-dev (10.1. 3-0ubuntu0.6) ...

After installing the library, and then to compile the QT program, you can compile the program normally.

Linux Mint (Application: QT 5.X compilation error)

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.