Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. India
  4. QGLWidget error

QGLWidget error

Scheduled Pinned Locked Moved India
7 Posts 5 Posters 16.7k Views
  • 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.
  • S Offline
    S Offline
    sruthy
    wrote on last edited by
    #1

    hai all,
    I'm completely new to Qt
    Iwant a QGLWidget in my project,
    so I added the following code:
    @GLWidget *openGL ;
    openGL=new GLWidget(this);@
    When I compiled this I got the following error:
    fatal error C1083: Cannot open include file: 'QGLWidget': No such file or directory
    Can anybody help me with this?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      ludde
      wrote on last edited by
      #2

      Perhaps you forgot to add @QT += opengl@ to your .pro file?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sruthy
        wrote on last edited by
        #3

        I've added it,but no change.It's the same error

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mlong
          wrote on last edited by
          #4

          Does it work if you use @#include <QtOpenGL/QGLWidget>@ instead of just @#include <QGLWidget>@ ?

          Software Engineer
          My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Thanatos.jsse
            wrote on last edited by
            #5

            [quote author="mlong" date="1329495288"]Does it work if you use @#include <QtOpenGL/QGLWidget>@ instead of just @#include <QGLWidget>@ ?[/quote]

            What's the difference between this declarations?

            BR,

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sruthy
              wrote on last edited by
              #6

              Hai all,thanks for the reply.
              It was due to the missing of include file ,
              so I added the following in my include
              ..\Qt\4.8.0\include\QtOpenGL
              and the foll: line in my C/C++->Preprocessor
              QT_OPENGL_LIB
              and the foll: line in my Linker->Input
              c:\Qt\4.8.0\lib\QtOpenGLd4.lib
              and I got it working.

              1 Reply Last reply
              0
              • Y Offline
                Y Offline
                yupifourbi
                wrote on last edited by
                #7

                I am newbie.
                Which file(s) should I edit to add those lines as sruthy suggested?
                Thanks in advance.

                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