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. [Solved] OpenGL doesnt work in latest QtSdk 1.1 beta
Forum Updated to NodeBB v4.3 + New Features

[Solved] OpenGL doesnt work in latest QtSdk 1.1 beta

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 5.2k 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.
  • J Offline
    J Offline
    john_god
    wrote on last edited by
    #1

    With the new version QtSdk 1.1 beta my existent project doesnt work , simple OpenGL functions are not recgnized

    @graph2Dclass\graph2d.cpp: In member function 'void Graph2D::draw()':
    graph2Dclass\graph2d.cpp:302: error: 'GL_LINE_STRIP' was not declared in this scope
    graph2Dclass\graph2d.cpp:302: error: 'glBegin' was not declared in this scope
    graph2Dclass\graph2d.cpp:314: error: 'glVertex3d' was not declared in this scope
    graph2Dclass\graph2d.cpp:328: error: 'glEnd' was not declared in this scope
    graph2Dclass\graph2d.cpp:335: error: 'glEnd' was not declared in this scope
    graph2Dclass\graph2d.cpp:345: error: 'glEnd' was not declared in this scope@

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      Do you have

      @QT += opengl@

      in your project's .pro file? What is the full command line passed to the compiler that generates the above error message?

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • J Offline
        J Offline
        john_god
        wrote on last edited by
        #3

        I have that line in the .pro file since it's a existente project. I found that OpenGL works with other project I have so probably it's not QtSdk installation problem.

        bq. What is the full command line passed to the compiler that generates the above error message?

        Do you mean this

        @Running build steps for project matematica...
        Configuration unchanged, skipping qmake step.
        Starting: "C:\QtSDK\mingw\bin\mingw32-make.exe" -w
        mingw32-make: Entering directory D:/qt4examples/Matematica_determinante' C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory D:/qt4examples/Matematica_determinante'
        g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\QtSDK\Desktop\Qt\4.7.2\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.7.2\mingw\include\QtGui" -I"c:\QtSDK\Desktop\Qt\4.7.2\mingw\include\QtOpenGL" -I"c:\QtSDK\Desktop\Qt\4.7.2\mingw\include" -I"." -I"." -I"c:\QtSDK\Desktop\Qt\4.7.2\mingw\include\ActiveQt" -I"debug" -I"." -I"c:\QtSDK\Desktop\Qt\4.7.2\mingw\mkspecs\win32-g++" -o debug\graph2d.o graph2Dclass\graph2d.cpp
        graph2Dclass\graph2d.cpp: In member function 'void Graph2D::draw()':
        graph2Dclass\graph2d.cpp:302: error: 'GL_LINE_STRIP' was not declared in this scope
        graph2Dclass\graph2d.cpp:302: error: 'glBegin' was not declared in this scope
        graph2Dclass\graph2d.cpp:314: error: 'glVertex3d' was not declared in this scope
        graph2Dclass\graph2d.cpp:328: error: 'glEnd' was not declared in this scope
        graph2Dclass\graph2d.cpp:335: error: 'glEnd' was not declared in this scope
        graph2Dclass\graph2d.cpp:345: error: 'glEnd' was not declared in this scope
        mingw32-make[1]: Leaving directory D:/qt4examples/Matematica_determinante' mingw32-make: Leaving directory D:/qt4examples/Matematica_determinante'
        mingw32-make[1]: *** [debug/graph2d.o] Error 1
        mingw32-make: *** [debug] Error 2
        The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
        Error while building project matematica (target: Desktop)
        When executing build step 'Make'@

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on last edited by
          #4

          Hmmm, yes that is what I meant. The command line looks fine. It is pulling in the correct include path for the QtOpenGL support and has the relevent define on the command line too (-DQT_OPENGL_LIB).

          As you say other OpenGL based projects work fine for you the error must be somewhere in this project. Can you post the .pro file and the source for this file that is failing to compile please?

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply
          0
          • J Offline
            J Offline
            john_god
            wrote on last edited by
            #5

            I found the error, it was missing a

            @#include <QGLWidget>@

            in graph2d.h. Althout this class is not QGLWidget derived, it is called from a QGLWidget object, and since it has OpenGL functions it was complaining about this missing header.

            I probably erased this include accidentally, since this was a existent project working ok in previous QtSdk versions.

            Thank you.

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              ZapB
              wrote on last edited by
              #6

              Ah, glad yu fixed it. Those bugs are a pain you can sit there staring at it for hours and not see it. Then a colleague walks by and spots it in 5 seconds ;-)

              Nokia Certified Qt Specialist
              Interested in hearing about Qt related work

              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