Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Cannot use GLU with OpenGL and Qt5.1



  • I've to draw a cylinder in a 3D scene that I've created using opengl.
    The simplest way is using the GLU functions, like in this case "gluCylinder " that do all for me, but campiling I've this error "error: 'gluCylinder' was not declared in this scope".
    May I include a particular header file?
    this is my project file conf:
    @QT += core gui opengl

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = opengltest
    TEMPLATE = app

    SOURCES += main.cpp
    myglwidget.cpp

    HEADERS +=
    myglwidget.h
    @

    all opengl directives are recognised well, but any glu function call fails... what is the problem?


  • Lifetime Qt Champion

    Hi,

    IIRC you need to include GL/glut.h and link against libglut



  • Thanks, I've resolved with you suggestion, but how can I create a full face paint cylinder? because gluCilynder only draws lateral surfaces.
    I have another question for you:
    if I have some static object on my 3d rendering space, and other are dinamics (that change their position), is there a way to not redraw also the statics one?

    [quote author="SGaist" date="1378243066"]Hi,

    IIRC you need to include GL/glut.h and link against libglut[/quote]


  • Lifetime Qt Champion

    Sorry, I can't help you there, I am not as fluent in OpenGL as I would like.

    You should rather ask these questions on an OpenGL dedicated forum


Log in to reply