Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get OpenGL ES2 to compile with Qt
    primarykey
    data
    text
    <p>I'm trying to figure out how to get my Qt program to compile and link against OpenGL ES2 functions.</p> <p>I've created a simple program that uses a QGLWidget to draw some simple triangles in my Qt application using the old OpenGL 1.0 pipeline. I'd like to use advanced 2.0 features like VBOs and shaders, so I started simply enough by trying to allocate some buffers for a VBO:</p> <pre><code>int ids[2]; glGenBuffers(2, ids); </code></pre> <p>Unfortunately, my project cannot find glGenBuffers() and I get the error message</p> <pre><code>GlWidget.cpp:103: error: 'glGenBuffers' was not declared in this scope </code></pre> <p>The start of qgl.h had the line "#elif defined(QT_OPENGL_ES_2)", so I tried setting that for the preprocessor, but it still couldn't find glGenBuffers().</p> <p>I'm not sure what to try next. Please let me know how I can get my Qt program to use OpenGL ES2.</p> <p>Here's the output I get when I compile:</p> <pre><code>"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE=/C/Qt/2010.02.1/qt/bin/qmake.exe SUBPROJECTS= .build-conf make[1]: Entering directory `/c/dev/kitfox.com/biz/monsterRacing/proj/CharacterEditor' /C/Qt/2010.02.1/qt/bin/qmake.exe VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro mv -f qttmp-Debug.mk nbproject/qt-Debug.mk "/usr/bin/make" -f nbproject/qt-Debug.mk dist/Debug/MinGW-Windows/CharacterEditor.exe make[2]: Entering directory `/c/dev/kitfox.com/biz/monsterRacing/proj/CharacterEditor' g++.exe -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/Qt/2010.02.1/qt/include/QtCore' -I'c:/Qt/2010.02.1/qt/include/QtGui' -I'c:/Qt/2010.02.1/qt/include/QtOpenGL' -I'c:/Qt/2010.02.1/qt/include' -I'c:/Qt/2010.02.1/qt/include/ActiveQt' -I'.' -I'.' -I'nbproject' -I'.' -I'c:/Qt/2010.02.1/qt/mkspecs/default' -o build/Debug/MinGW-Windows/main.o main.cpp g++.exe -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/Qt/2010.02.1/qt/include/QtCore' -I'c:/Qt/2010.02.1/qt/include/QtGui' -I'c:/Qt/2010.02.1/qt/include/QtOpenGL' -I'c:/Qt/2010.02.1/qt/include' -I'c:/Qt/2010.02.1/qt/include/ActiveQt' -I'.' -I'.' -I'nbproject' -I'.' -I'c:/Qt/2010.02.1/qt/mkspecs/default' -o build/Debug/MinGW-Windows/MainForm.o MainForm.cpp MainForm.cpp: In member function 'void MainForm::openFile()': MainForm.cpp:78: warning: unused variable 'surfSet' g++.exe -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/Qt/2010.02.1/qt/include/QtCore' -I'c:/Qt/2010.02.1/qt/include/QtGui' -I'c:/Qt/2010.02.1/qt/include/QtOpenGL' -I'c:/Qt/2010.02.1/qt/include' -I'c:/Qt/2010.02.1/qt/include/ActiveQt' -I'.' -I'.' -I'nbproject' -I'.' -I'c:/Qt/2010.02.1/qt/mkspecs/default' -o build/Debug/MinGW-Windows/GlWidget.o GlWidget.cpp GlWidget.cpp: In member function 'void GlWidget::buildMesh()': GlWidget.cpp:103: error: 'glGenBuffers' was not declared in this scope make[2]: Leaving directory `/c/dev/kitfox.com/biz/monsterRacing/proj/CharacterEditor' make[2]: *** [build/Debug/MinGW-Windows/GlWidget.o] Error 1 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 make[1]: Leaving directory `/c/dev/kitfox.com/biz/monsterRacing/proj/CharacterEditor' </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload