<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Setting up Opengl ES2 in Qt]]></title><description><![CDATA[<p dir="auto">Hi<br />
I'm tring to dive in to the world of shaders. Before using Qt Opengl functions I'm tring to use raw OpenGL,<br />
I'm following the triangle example from the book ES 2.0 Programming Guide. I created a function in a QGLWiddget</p>
<p dir="auto">@GLuint graph3DWidget::LoadShader(const char *shaderSrc, GLenum type)<br />
{<br />
GLuint shader;<br />
GLint compiled;</p>
<p dir="auto">// Create the shader object<br />
shader = glCreateShader(type);<br />
if(shader == 0)<br />
return 0;<br />
// Load the shader source<br />
glShaderSource(shader, 1, &amp;shaderSrc, NULL);</p>
<p dir="auto">// Compile the shader<br />
glCompileShader(shader);<br />
// Check the compile status<br />
glGetShaderiv(shader, GL_COMPILE_STATUS, &amp;compiled);<br />
if(!compiled)<br />
{<br />
GLint infoLen = 0;<br />
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &amp;infoLen);</p>
<pre><code>    if(infoLen &gt; 1)
    {
       char* infoLog = (char *)malloc(sizeof(char) * infoLen);
       glGetShaderInfoLog(shader, infoLen, NULL, infoLog);
       qDebug("Error compiling shader:\n%s\n", infoLog);
       //esLogMessage("Error compiling shader:\n%s\n", infoLog);
       free(infoLog);
    }
    glDeleteShader(shader);
    return 0;
 }
 return shader;
</code></pre>
<p dir="auto">}@</p>
<p dir="auto">Errors:</p>
<p dir="auto">@debug/graph3dwidget.o:C:\nokiaqtapps\QtMobileOpenGL-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug/../QtMobileOpenGL/graph3dwidget.cpp:48: undefined reference to <code>_imp____glewCreateShader' debug/graph3dwidget.o:C:\nokiaqtapps\QtMobileOpenGL-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug/../QtMobileOpenGL/graph3dwidget.cpp:52: undefined reference to </code><em>imp____glewShaderSource'<br />
debug/graph3dwidget.o:C:\nokiaqtapps\QtMobileOpenGL-build-desktop-Qt_4_7_4_for_Desktop</em>-_MinGW_4_4__Qt_SDK__Debug/../QtMobileOpenGL/graph3dwidget.cpp:55: undefined reference to <code>_imp____glewCompileShader' debug/graph3dwidget.o:C:\nokiaqtapps\QtMobileOpenGL-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug/../QtMobileOpenGL/graph3dwidget.cpp:57: undefined reference to </code><em>imp____glewGetShaderiv'<br />
debug/graph3dwidget.o:C:\nokiaqtapps\QtMobileOpenGL-build-desktop-Qt_4_7_4_for_Desktop</em>-_MinGW_4_4__Qt_SDK__Debug/../QtMobileOpenGL/graph3dwidget.cpp:61: undefined reference to <code>_imp____glewGetShaderiv' debug/graph3dwidget.o:C:\nokiaqtapps\QtMobileOpenGL-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug/../QtMobileOpenGL/graph3dwidget.cpp:66: undefined reference to </code><em>imp____glewGetShaderInfoLog'<br />
debug/graph3dwidget.o:C:\nokiaqtapps\QtMobileOpenGL-build-desktop-Qt_4_7_4_for_Desktop</em>-_MinGW_4_4__Qt_SDK__Debug/../QtMobileOpenGL/graph3dwidget.cpp:71: undefined reference to `_imp____glewDeleteShader'<br />
collect2: ld returned 1 exit status<br />
mingw32-make[1]: *** [debug\QtMobileOpenGL.exe] Error 1<br />
mingw32-make: *** [debug] Error 2<br />
The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.<br />
Error while building project QtMobileOpenGL (target: Desktop)<br />
When executing build step 'Make'@</p>
<p dir="auto">I'm using windows 7 64bits, and latest QtSDK with mingw. I installed glew 1.7.0 64bits version, pre compiled. I copied the glew.h and glew32.lib to<br />
C:\QtSDK\mingw\include\GL and glew32.dll to windows\system32 and to C:\QtSDK\mingw\bin.</p>
<p dir="auto">The errors I got show that problably there's a incompatible version in glew library, but I using latest version. I also have used glew include before QGLWidget include</p>
<p dir="auto">@#include &lt;GL/glew.h&gt;<br />
#include &lt;QGLWidget&gt;<br />
//#include &lt;QtOpenGL&gt;<br />
//#include &lt;GL/gl.h&gt;@</p>
<p dir="auto">I'm thinking also if perhaps these precompiled glew binarys are incomptible with mingw ?<br />
Any ideias ????</p>
]]></description><link>https://forum.qt.io/topic/10226/setting-up-opengl-es2-in-qt</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Mar 2026 19:44:04 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/10226.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 08 Oct 2011 09:52:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Setting up Opengl ES2 in Qt on Thu, 03 Nov 2011 22:09:31 GMT]]></title><description><![CDATA[<p dir="auto">You can write ogl es 2.0 compliant OpenGL code on desktop using GLEW for instance. Then again I dont use windows to do so, on Linux I just install the glew packages from apt and compile away.</p>
]]></description><link>https://forum.qt.io/post/115521</link><guid isPermaLink="true">https://forum.qt.io/post/115521</guid><dc:creator><![CDATA[matti-]]></dc:creator><pubDate>Thu, 03 Nov 2011 22:09:31 GMT</pubDate></item><item><title><![CDATA[Reply to Setting up Opengl ES2 in Qt on Tue, 11 Oct 2011 12:45:02 GMT]]></title><description><![CDATA[<p dir="auto">Hi John_god,<br />
Are you trying to build an opengl ES 2.0 based app in a desktop version? I guess it won't work... as far as I remenber, only openGL 4.0 compliant context can manage OGL ES specific code, and I assume that QGL API cannot do that yet.<br />
If you want to get start with shaders, just begin with desktop opengl 3.2 core profile, migration to opengl ES 2.0 is easy afterward.</p>
]]></description><link>https://forum.qt.io/post/112878</link><guid isPermaLink="true">https://forum.qt.io/post/112878</guid><dc:creator><![CDATA[tomato]]></dc:creator><pubDate>Tue, 11 Oct 2011 12:45:02 GMT</pubDate></item><item><title><![CDATA[Reply to Setting up Opengl ES2 in Qt on Sat, 08 Oct 2011 17:47:41 GMT]]></title><description><![CDATA[<p dir="auto">glew has a makefile, I tried compiling in linux with the command make, also got errors</p>
<p dir="auto">@/bin/sh: 1: config/config.guess: not found<br />
/bin/sh: 1: config/config.guess: not found<br />
Makefile:40: *** "Platform '' not supported".  Stop.<br />
@</p>
<p dir="auto">In windows I coulnt compile it in QtCreator. Also I know about VS express but I'm trying to avoid it.<br />
Seems I'm stuck. I'll digg further to try to comple it in windows.</p>
<p dir="auto">Also in linux I installed glew with apt-get. Didnt recognize functions like glCreateShader(). Then I manually  copied glew.h to /usr/include/GL.  Now I got the same type of errors I got in windows:</p>
<p dir="auto">@graph3dwidget.o: In function <code>graph3DWidget::LoadShader(char const*, unsigned int)': make: Leaving directory </code>/home/joao/qt4projects/QtMobileOpenGL-build-desktop-Desktop_Qt_4_7_4_for_GCC__Qt_SDK__Release'<br />
graph3dwidget.cpp:(.text+0x47): undefined reference to <code>__glewCreateShader' graph3dwidget.cpp:(.text+0x78): undefined reference to </code>__glewShaderSource'<br />
graph3dwidget.cpp:(.text+0x80): undefined reference to <code>__glewCompileShader' graph3dwidget.cpp:(.text+0x92): undefined reference to </code>__glewGetShaderiv'<br />
graph3dwidget.cpp:(.text+0xb9): undefined reference to <code>__glewGetShaderiv' graph3dwidget.cpp:(.text+0xde): undefined reference to </code>__glewGetShaderInfoLog'<br />
graph3dwidget.cpp:(.text+0xfd): undefined reference to `__glewDeleteShader'<br />
collect2: ld returned 1 exit status<br />
make: *** [QtMobileOpenGL] Error 1<br />
The process "/usr/bin/make" exited with code 2.<br />
Error while building project QtMobileOpenGL (target: Desktop)<br />
When executing build step 'Make'@</p>
]]></description><link>https://forum.qt.io/post/112592</link><guid isPermaLink="true">https://forum.qt.io/post/112592</guid><dc:creator><![CDATA[john_god]]></dc:creator><pubDate>Sat, 08 Oct 2011 17:47:41 GMT</pubDate></item><item><title><![CDATA[Reply to Setting up Opengl ES2 in Qt on Sat, 08 Oct 2011 13:44:08 GMT]]></title><description><![CDATA[<p dir="auto">visual studio libs and mingw are not compatible. Even more, apparently different versions of visual studio libs may not be compatible. However, never tested.<br />
There is also the possibility to use visual studio express with Qt, if you cannot get forward with the glew lib compilation. The visual studio express edition you can just downlaod. Unfortunately you cannot use the qt addins then.</p>
<p dir="auto">For the compiling of glew with mingw, do you have makefiles for glew? Maybe you can load to qt creator and compile from there. Unfortunately, I have no experience with mingw.</p>
]]></description><link>https://forum.qt.io/post/112588</link><guid isPermaLink="true">https://forum.qt.io/post/112588</guid><dc:creator><![CDATA[koahnig]]></dc:creator><pubDate>Sat, 08 Oct 2011 13:44:08 GMT</pubDate></item><item><title><![CDATA[Reply to Setting up Opengl ES2 in Qt on Sat, 08 Oct 2011 12:50:07 GMT]]></title><description><![CDATA[<p dir="auto">I did not compile Qt for 64 bit. I just tested the 32 bit glew, I still have errors. I've been goggling it seems that glew32.lib is for use with Visual Studio, for mingw it should be compiled so I can get a glew32.a. Right now I'm googling on how to compile glew with mingw, also any help on this will be greatly apreciated.</p>
<p dir="auto">Many thanks so far<br />
Joao</p>
]]></description><link>https://forum.qt.io/post/112580</link><guid isPermaLink="true">https://forum.qt.io/post/112580</guid><dc:creator><![CDATA[john_god]]></dc:creator><pubDate>Sat, 08 Oct 2011 12:50:07 GMT</pubDate></item><item><title><![CDATA[Reply to Setting up Opengl ES2 in Qt on Sat, 08 Oct 2011 11:14:00 GMT]]></title><description><![CDATA[<p dir="auto">Did you test with the 32 bit glew lib?<br />
You say explicitely that you installed 64 bit glew, but do you use also 64 bit compilation for Qt?</p>
]]></description><link>https://forum.qt.io/post/112579</link><guid isPermaLink="true">https://forum.qt.io/post/112579</guid><dc:creator><![CDATA[koahnig]]></dc:creator><pubDate>Sat, 08 Oct 2011 11:14:00 GMT</pubDate></item></channel></rss>