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. QtOpenGL and GL Libraries conflict
Forum Updated to NodeBB v4.3 + New Features

QtOpenGL and GL Libraries conflict

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.8k 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.
  • A Offline
    A Offline
    aysenur
    wrote on last edited by
    #1

    I am trying to do an opengl example from a video on youtube. I am doing the same thing but in glEnable(GL_LIGHT0); line my qt gives error. It gives error also for GL_LIGHTING, GL_COLOR_MATERIAL. Error is; GL_LIGHT0 was not declared in this scope. Later I added #include <GL/glu.h> and program recognized this enable methods but at this time gave another error which is: conflicting decleration 'typedef double GLdouble' and other conflicting errors. How to declare these methods. In the video he does not have such an error. Thank you inadvance.

    A 1 Reply Last reply
    0
    • A aysenur

      I am trying to do an opengl example from a video on youtube. I am doing the same thing but in glEnable(GL_LIGHT0); line my qt gives error. It gives error also for GL_LIGHTING, GL_COLOR_MATERIAL. Error is; GL_LIGHT0 was not declared in this scope. Later I added #include <GL/glu.h> and program recognized this enable methods but at this time gave another error which is: conflicting decleration 'typedef double GLdouble' and other conflicting errors. How to declare these methods. In the video he does not have such an error. Thank you inadvance.

      A Offline
      A Offline
      aysenur
      wrote on last edited by
      #2

      The problem is for adding include<QGLWidget> we need opengl library. We add this in pro file. For using glBegin, glVertex3d, glColor3f methods we need to include GL/gl.h library. But when this has been added, qt gives conflict error.

      W 1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Which version of Qt are you using ?

        If Qt 5, then you should consider using QOpenGLWidget. In the documentation of the class here, you have the explanation on how to call standard OpenGL functions.

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

        A 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Which version of Qt are you using ?

          If Qt 5, then you should consider using QOpenGLWidget. In the documentation of the class here, you have the explanation on how to call standard OpenGL functions.

          A Offline
          A Offline
          aysenur
          wrote on last edited by
          #4

          @SGaist I downloaded qt default and this is qt 5.3.2. Later I downloaded qt everywhere 5.9. I referenced both of them in the tools Option, Qt Versions tab.

          1 Reply Last reply
          0
          • A aysenur

            The problem is for adding include<QGLWidget> we need opengl library. We add this in pro file. For using glBegin, glVertex3d, glColor3f methods we need to include GL/gl.h library. But when this has been added, qt gives conflict error.

            W Offline
            W Offline
            wrosecrans
            wrote on last edited by
            #5

            @aysenur FYI, if you are learning glBegin and glEnd, you are learning some very outdated and deprecated functionality. A modern OpenGL "Core" Profile will no longer support that functionality.

            A 1 Reply Last reply
            0
            • W wrosecrans

              @aysenur FYI, if you are learning glBegin and glEnd, you are learning some very outdated and deprecated functionality. A modern OpenGL "Core" Profile will no longer support that functionality.

              A Offline
              A Offline
              aysenur
              wrote on last edited by
              #6

              @wrosecrans Thank you for your reply. What do you prefer ? I want to view stl file, I found different examples like e8johan stlviewer from github. It works on ubuntu in my computer but when I downloded it on my raspberry pi it gives conflict error. Stlviewer both uses opengl and GL libraries at the same time.

              1 Reply Last reply
              0

              • Login

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