Hi all,
I’m a noob trying to get some simple shader demos working. When I try to compile my project, I get undefined symbols for shader-related code (but if I revert to old skool openGL, it compiles fine).
I am using QT4 to handle windows and contexts and such, so I created my own widget class that inherits from QGLWidget and overrides virtual methods as needed. Again, it all works fine until I start adding shader-related code. For example, this method
void initializeGL()
{
glClearColor( 0.0, 0.03f, 0.09f, 0.0 );
glEnable( GL_DEPTH_TEST );
timer.start( 20 );
angle = 0;
// Try making a vertex shader
std::string vertShadeSrc;
if( loadTextFile( "VShaderWhite.fx", vertShadeSrc ) )
{
GLuint vertShade
= glCreateShaderARB( GL_VERTEX_SHADER );
int numStrings = 1;
glShaderSource( vertShade,
&( vertShadeSrc.c_str() ),
&numStrings );
glCompileShader( vertShade );
}
}
gives the following errors:
1>c:\users\dave\documents\code\glext_test\glext_test\myglwidget.h(57): error C3861: ‘glCreateShaderARB’: identifier not found
1>c:\users\dave\documents\code\glext_test\glext_test\myglwidget.h(59): error C3861: ‘glShaderSource’: identifier not found
1>c:\users\dave\documents\code\glext_test\glext_test\myglwidget.h(60): error C3861: ‘glCompileShader’: identifier not found
My includes at the top of the file are:
#include <QGLWidget>
#include <QTimer>
#include <gl/GLU.h>
#include <gl/glext.h>
#include <iostream>
#include <fstream>
#include <sstream>
My development environment is Visual C++ 2010 Express, which apparently doesn’t come with its own headers for glext, so I downloaded them here:
http://www.opengl.org/registry/
Alas, that doesn’t solve the problem. So, what do I have to download/install to get shaders working in VC++ Express?
Thanks.