View Full Version : errors at compilation
05-25-2005, 02:19 PM
i have written this :
hvs = CreateShader(VERTEX_SHADER);
and my errors are :
error C2065: 'CreateShader' : undeclared identifier
error C2065: 'VERTEX_SHADER' : undeclared identifier
I have the latest drivers for my ATI card (it works perfectly with render monkey), i don't understand because i have read this in the opengl 2.0 specs
can you help me ?
05-25-2005, 02:29 PM
Try glCreateShader and GL_VERTEX_SHADER. And of course, make sure you have setup all function pointers and so on.
Personally, I never understood the point of excluding the GL_ and gl from all names and enums in the spec.
05-25-2005, 02:37 PM
it works for GL_VERTEX_SHADER but not with glCreateShader. :-(
what do you mean by "setup all function pointers and so on" ?
05-25-2005, 02:37 PM
Try glCreateShader and GL_VERTEX_SHADER
You sure you have the latest headers and are using someting like GLee/Glew?
05-25-2005, 02:39 PM
about the headers, i just use glext.h
05-26-2005, 02:44 AM
Anything above OpenGL 1.1 should be accessed with the extension loading mechanism. On Windows you don't have a choice, and on Linux it is still better not to statically link to the functions.
On Windows the extension loading works like this:
glCreateShader = wglGetProcAddress("glCreateShader");Be sure to check the version string for OpenGL 2.0 support before you do this.
Alternatively you could use glew or a similar extension loading library...
05-26-2005, 04:49 AM
ok, thanks guys
05-26-2005, 02:48 PM
Hi, you may also check out GLEW, glew.sourceforge.net. It does a wonderful job of loading extensions.
05-27-2005, 02:47 AM
Another possibility much better (I think) than the glGetProcAddress(...) and the glew library, is to use the static library of ATI (which work also for other vendor hardware, unless you use ATI extensions).
You can dowload them on the ATI web side (just downloading a "sample project")
you have just to link
to your project
in your source
It is better than glGetProcAddress because it's very painful to write this "linkage" section for each extensions.
In my opinion is also better than the glew because is released by an official OpenGL vendor and it is straightforward to use (of course you can think different).
At the Setup phase, in your source, you have just to write
or another version.
To load specific extensions:
05-27-2005, 04:06 AM
ok thanks for your tips :D
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.