PDA

View Full Version : Problem with opengl



rajg
25th July 2012, 10:12
Dear All,

I am having some problem with using openGL in Qt 4. When I try to include <OpenGL> or <QtGLWidget> but, it does not support.

I have added a paramter
QT += opengl in my .pro file. But then also my problem not solved. I have doubt that my system have the driver for openGl or not? I am using ubuntu 10.4 lts.

So please tell me how will I check that whether my system supports OpenGL or not?
In case if it does not support openGL, how will i install it?

And, finally I need to use <QtGLWidget> & <qgl.h> in program. So how to solve this?

Thanks.

high_flyer
25th July 2012, 11:24
https://answers.launchpad.net/ubuntu/+question/56826

rajg
26th July 2012, 09:03
Thank you high_flyer and all,

Now I have installed and check.
OpenGL is enabled in my system. But still I am not able to include<OpenGL> and <QtGlWidget> in Qt.
How to enable OpenGL in Qt. I tried it from using ./configure command. But i got the error "command not found". And configure command is not there in Qt directory.

So, please tell me how to enable <OpenGL> in Qt.

Thanks.

high_flyer
26th July 2012, 09:38
ow to enable OpenGL in Qt. I tried it from using ./configure command. But i got the error "command not found". And configure command is not there in Qt directory.
Sounds like the Qt develop environment is not installed.
Check with your favorite package installer for Qt development package, and the Qt source.

rajg
26th July 2012, 09:48
I have installed:
-> qt-everywhere-opensource-src-4.8.0.tar.gz and
-> qt-creator-linux-x86-opensource-2.5.0.bin

I checked "include" directory. 'QtOpenGL' is not there.
Please tell me how to solve this.


Thanx.

high_flyer
26th July 2012, 09:55
What do you mean by "installed"?
Can you list the steps from downloading to building?

rajg
26th July 2012, 10:09
Probably I used the following:

First i unzipped. then:

./configure

make

su -c make install

high_flyer
26th July 2012, 13:25
What did the output of configure say?
Maybe it could not build your opengl module due to missing dependencies.

rajg
31st July 2012, 05:38
I haven't remember that what was the message at that time.

I again reinstalled Qt.
But again OpenGL support I am not getting. Please instruct me the how to get it.

Thanx.

ChrisW67
31st July 2012, 06:21
Dear All,

I am having some problem with using openGL in Qt 4. When I try to include <OpenGL> or <QtGLWidget> but, it does not support.

The first include has nothing to do with Qt unless you meant:


#include <QtOpenGL>


The second include should be:


#include <QGLWidget>

Note: no 't'.

This process would have been much easier if you had posted the actual compiler error messages which presumably read "File not found" or the like.

rajg
31st July 2012, 06:56
Thank you for notice ChrisW67,

It was typo for here.
In program code I am using exactly what you have mentioned.
But the main problem is that, Qt is not taking the support of 'OpenGL'. I am trying to resolve this.

Thanx.

ChrisW67
31st July 2012, 07:13
What is the error message? What does "not taking the support of OpenGL" mean?

rajg
31st July 2012, 07:26
When I Run the code, the following error message comes:

QtOpenGL : no such file or directory.
QGlWidget : no such file or directory.

When OpenGL is there in Qt then it should present in 'include' directory. But it is not there.
So please, tell me how to include and use OpenGL in Qt.

Thanx.

ChrisW67
31st July 2012, 07:37
The error messages you have paraphrased look like error messages from the compiler: they have nothing to do with running the program. Once again you have mistyped QGLWidget. Copy and paste the actual error messages and the commands that generated them. In Qt Creator they appear in the Compiler Output pane.

If the files QtOpenGL and QGLWidget do not appear on your system then you have to:

install a package containing that library and includes from the Ubuntu repositiory, or
or build your own Qt libraries from source with Open GL support.

Which do you think you have done? If Qt OpenGL support is totally absent on your system then chances are that qmake is generating a message about the "opengl" option in the QT variable... have you looked?