tags:

views:

87

answers:

3

Hi I just have installed Qt 4 on windows 7. I am now in a bit of a confusion How do I get to install OpenGL so that it works with QT? Is there an installer for OpenGL? Qt docs. say it has support for OpenGL, but when I include QTOpenGL and build, the compiler issues an error of "No such file or directory"

Thanks for the reply in advance!

+3  A: 

What tool chain are you using? (Visual Studio, Qt Creator/g++) You need to specify somewhere in your project settings that you want to use the QtOpenGL module. This will result in a line in your .pro file similar to this:

QT = core gui opengl

This causes qmake to add the proper include path when invoking the compiler (I believe).

Arnold Spence
I am using QT Creator and added the line QT += opengl to the .pro fileTHANK YOU SO MUCH!!!
Wajih
+3  A: 

Are you sure you followed this to the letter? You need to include <QtOpenGL> and set the QT += opengl option in your pro file.

rubenvb
Well I almost followed the whole, just missed QT+= opengl
Wajih
+1  A: 

added the line QT += opengl to the .pro file

Wajih