QT cannot use OpenGL solution after installing QT and OpenGL under Linux

Source: Internet
Author: User

My system for Ubuntu14.04, with Apt-get installed the implementation of OpenGL MESA,QT is the official website to download the run file to install.

OK, now two are all there, so try to write OpenGL code under QT.

Before trying to paste the code in vim and then compile, the test succeeds is a statement containing one of the following compilation options.

1 GCC

But directly paste the code into the QT creator Click Run, but there are multiple error messages, the call function is not found, that is, QT has not been connected to use the installed OpenGL library.

Many of the solutions on the Web have been added to the QT project's. Pro file:

Plus QT + + OpenGL

There are also additional config+= qt OpenGL warn_on release

Finally, I found this sentence. LIBS =-lopengl32-lglut32-lglut-lglu32

The first two experiments proved to be invalid, or to solve the problem does not play a role, the latter reminds me of the above compiler statements in the options, and then change those options to the above compilation statement options:

That is, you just need to add this line:

1 LIBS =-lgl-lglu-lglut

Then the run succeeds and the problem is resolved.

QT cannot use OpenGL solution after installing QT and OpenGL under Linux

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.