Hello !
I try to make QT application with OpenGL graphics. I subclass QGLWidget and try draw cylinder such this
#include <QDebug>
#include <QMouseEvent>
#include <GL/glu.h>
#include <GL/glu_mangle.h>
#include "glwidget.h"
...
void GLWidget :: paintGL (void)
{
qDebug () << __FUNCTION__;
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
GLUquadricObj* q = new gluNewQuadric ();
gluCylinder (q, (GLdouble)cyl_radius, (GLdouble)cyl_radius, (GLdouble)cyl_height, 1000, 1000);
}
#include <QDebug>
#include <QMouseEvent>
#include <GL/glu.h>
#include <GL/glu_mangle.h>
#include "glwidget.h"
...
void GLWidget :: paintGL (void)
{
qDebug () << __FUNCTION__;
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
GLUquadricObj* q = new gluNewQuadric ();
gluCylinder (q, (GLdouble)cyl_radius, (GLdouble)cyl_radius, (GLdouble)cyl_height, 1000, 1000);
}
To copy to clipboard, switch view to plain text mode
and I receive an error
glwidget.cpp: In member function ‘virtual void GLWidget:

aintGL()’:
glwidget.cpp:59: error: expected type-specifier before ‘mgluNewQuadric’
glwidget.cpp:59: error: cannot convert ‘int*’ to ‘GLUquadricObj*’ in initializat
ion
glwidget.cpp:59: error: expected ‘,’ or ‘;’ before ‘mgluNewQuadric’
glwidget.cpp:60: error: ‘mgluCylinder’ was not declared in this scope
make: *** [glwidget.o] Error 1
(3 of 7): error: expected type-specifier before ‘mgluNewQuadric’
In pro-file I write
DEPENDPATH += . \
/usr/include/GL
INCLUDEPATH += . \
/usr/include/GL
QT += opengl
...
DEPENDPATH += . \
/usr/include/GL
INCLUDEPATH += . \
/usr/include/GL
QT += opengl
...
To copy to clipboard, switch view to plain text mode
My platform is Gentoo Linux, QT was compiled with opengl support. Any ideas ?
Bookmarks