0

I followed this turial to create a very simple openGL program with QT.

I have QT 5.0. I created a new empty QT project, created all files as in the tutorial but the compilation failed. The cause is that certain methods like glShadeModel() are not recognized. I tried include GL/glu.h (which include glShadeModel for instance) but this time there is a conflict with several openGL types. But according to the tutorial all opengl methods should be included in QtOpenGL. Maybe I have a too much recent version of QT. I'm lost.

Does anyone can help me ?

4
  • I don't think 5.0 is a problem, it still supports QGLWidget, which is what the example is based on. Are you having linker issues or compiler? It may be that it's just not finding Qt's GL support. I've had troubles on both Windows and Linux where that wasn't installed out of the box (or my .pro file didn't know where to look for the libraries). You shouldn't need - and probably don't want - GLU. Commented Apr 3, 2013 at 21:10
  • 2
    Instead of an older 3rd party example, why don't you get Qt's (5.0) "Hello GL" working first. qt-project.org/doc/qt-5.0/qtopengl/hellogl.html. That will ensure you have everything installed and configured correctly. Commented Apr 3, 2013 at 21:13
  • Hello. I have already linked the include and lib folders in my .pro. My program compile without the opengl functions calls. I'm going to test the 'Hello GL'. Commented Apr 3, 2013 at 21:18
  • stackoverflow.com/questions/15048729/… The above answer should help. Good luck. Commented Apr 3, 2013 at 23:37

2 Answers 2

1

Qt5 is based on OpenGL ES 2.0, and this is a subset of desktop OpenGL, even some Qt tutorials are not adapted to this change yet. You will have to build Qt 5.0 with normal OpenGL if you wish to compile those tutorials.

Sign up to request clarification or add additional context in comments.

1 Comment

This is the unfortunate truth. I will never understand why Qt removed desktop OpenGL from the default distribution.
0

i may only give you some points to check. in .pro

*QT += opengl

*check your GPU for supporting the opengl version you are using, for example my laptop is only compatible with 2.1 opengl.

also please use "Qt" instead "QT", QT stands for quicktime by Apple.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.