Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Qt and OpenGL problems
QtWS25 Last Chance

Qt and OpenGL problems

Scheduled Pinned Locked Moved Game Development
2 Posts 2 Posters 3.6k 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.
  • X Offline
    X Offline
    xingped
    wrote on last edited by
    #1

    I'm using Qt Creator with OpenGL on Windows 7 to build a very simple project (to draw dots, lines, and triangles). First trouble I'm having that's throwing an error and not letting me build (on a project that I know worked before I wiped my computer about a month ago) is these two errors:

    @'glEnableVertexAttribArray' was not declared in this scope
    'glVertexAttribPointer' was not declared in this scope@

    I think I've written up my .pro file correctly:

    @QT += core gui opengl
    TARGET = firstProject
    TEMPLATE = app

    SOURCES += main.cpp
    glwidget.cpp

    HEADERS += glwidget.h

    OTHER_FILES +=
    std.vert
    std.frag

    LIBS += -L./lib -lglew32

    INCLUDEPATH += ./include@

    and I've included GL/glew.h, QtGui/QWidget, and QtOpenGL in my project. 'lib' and 'include' are two folders that include the glew libs and include files and glew32.dll is in the same folder with the rest of the source files. Any ideas?

    Another problem I'm having is that I'm suddenly getting a lot of warnings that GLEW is incompatible with and not to include QtOpenGL or QGLFunctions. If I take out QtOpenGL though, I get a whole heck of a lot more errors. What are these warnings trying to tell me and how can I fix them or approach them appropriately?

    Here is my github project if you'd like to look at the project in full: "https://github.com/xingped/qt-opengl/tree/master/CAP4720-HW2":https://github.com/xingped/qt-opengl/tree/master/CAP4720-HW2

    1 Reply Last reply
    0
    • M Offline
      M Offline
      morris.beverly
      wrote on last edited by
      #2

      I've had problems with glew myself and was able to work around it by making sure glew.h (actually gltools.h in my case) was before any qt opengl header files in my source. With multiple header files, this was surprisingly difficult, but it finally worked after some re-arranging.

      morris

      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