Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Cannot use GLU with OpenGL and Qt5.1
Forum Updated to NodeBB v4.3 + New Features

Cannot use GLU with OpenGL and Qt5.1

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mikecurl91
    wrote on 3 Sept 2013, 10:02 last edited by
    #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?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Sept 2013, 21:17 last edited by
      #2

      Hi,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mikecurl91
        wrote on 4 Sept 2013, 07:00 last edited by
        #3

        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]

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 4 Sept 2013, 20:22 last edited by
          #4

          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

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          1/4

          3 Sept 2013, 10:02

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved