Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to get Qt Creator to build OpenGL (ES) 2.x programs?
Qt 6.11 is out! See what's new in the release blog

How to get Qt Creator to build OpenGL (ES) 2.x programs?

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 1 Posters 3.6k 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
    matti-
    wrote on last edited by
    #1

    Hi. With the upcoming N9 release I'm getting into OpenGL again. I wrote a few test projects in Qt (linux/desktop target) and am unable to compile them due to missing opengl 2.x (headers?). My project is inheriting from QGLWidget as per (the few available) examples. OpenGL 1.x works fine, but obviously I need 2.x so I can compile for a device with OpenGL 2.0 ES.

    What should I install in order to get Qt to compile for OGL 2.x? My environment is x64 Ubuntu 11.04, qtcreator 2.1.0-0ubuntu2, installed from standard apt repository.

    Do I need a newer (2.3.x?) Qt Creator and/or reconfigure/recompile the whole Qt or something..?

    Exact error being:

    g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I../../trunk -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../../trunk -I../include -I/usr/X11R6/include -I. -I. -I. -o GLWidget.o ../src/GLWidget.cpp
    ../src/GLWidget.cpp: In member function ‘void GLWidget::DrawCube()’:
    ../src/GLWidget.cpp:158:48: error: ‘glVertexAttribPointer’ was not declared in this scope
    ../src/GLWidget.cpp:159:32: error: ‘glEnableVertexAttribArray’ was not declared in this scope
    make: *** [GLWidget.o] Error 1

    ty in advance,

    • matti

    Author of <a href="http://mmark.777-team.org/">MMark13</a>

    1 Reply Last reply
    0
    • M Offline
      M Offline
      matti-
      wrote on last edited by
      #2

      So I got as far as to use GLew to get it going on the desktop. When building for Harmattan (/other opengl es 2.0 device), I assume all the proper headers/libs will be there and I'll just need to #ifdef out the GLew stuff from code and .pro (-lGLEW)?

      Author of <a href="http://mmark.777-team.org/">MMark13</a>

      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