OpenGL Example - Cube Doesn't run
-
added this line in the cubo.pro file,
QT += opengl
but, no change. Still, its showing 2 errors.
I am using windows 7.
-
This is caused by a bug in the Cube example which has already been fixed in our repository for an upcoming version. Applying the following patch should solve it for you:
@
#ifndef GEOMETRYENGINE_H
#define GEOMETRYENGINE_H+#include <QtOpenGL/QGLFunctions>
#include <QtOpenGL/QGLShaderProgram>-class GeometryEngine
+class GeometryEngine : protected QGLFunctions
{
public:
GeometryEngine();
@ -
Previous errors hasn't solved. It also says,
C:\QtSDK\Examples\4.7\opengl\cube-build-desktop..\cube\geometryengine.h:4: error: QtOpenGL/QGLFunctions: No such file or directory
Code:
@#ifndef GEOMETRYENGINE_H
#define GEOMETRYENGINE_H#include <QtOpenGL/QGLFunctions>
#include <QtOpenGL/QGLShaderProgram>class GeometryEngine : protected QGLFunctions
{
public:
GeometryEngine();
virtual ~GeometryEngine();void init(); void drawCubeGeometry(QGLShaderProgram *program);
private:
void initCubeGeometry();GLuint *vboIds;
};
#endif // GEOMETRYENGINE_H@
-
The qglfunctions.cpp is only available in Qt 4.8, so this example will not build against Qt 4.7, you need a Qt 4.8 snapshot to make it build. I have created a "bug report":http://bugreports.qt.nokia.com/browse/QTBUG-19970 for this in our Bug Tracker.
-
Any idea when Qt 4.8 is gonna be available?
-
We don't have an exact date for this yet, but you can find some information on this in the public roadmap provided "here":http://developer.qt.nokia.com/wiki/Category:Developing_Qt::Qt_Planning::Qt_Public_Roadmap.
-
I really needed to run this example to investigate some procedures. Is there any way to run this example? :(
-
Sure, get a Qt 4.8 from GIT, and compile it yourself. That should work.
-
Hi,
Download the modified cube project in the zip here
https://bugreports.qt-project.org/browse/QTBUG-24555It worked for me.
-
Thank you!
I'll check it out sometime later.