[source lang="plain"]game/assets.c:178: error: ‘GL_VERTEX_SHADER’ undeclared (first use in this function)game/assets.c:178: error: (Each undeclared identifier is reported only oncegame/assets.c:178: error: for each function it appears in.)game/assets.c:182: error: ‘GL_FRAGMENT_SHADER’ undeclared (first use in this function)[/source]
I'm using the following #includes:
[source lang="plain"]#ifdef _WIN32 #include "../win/dirent.h"#else #include <dirent.h>#endif#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include <errno.h>#include <string.h>#include <GL/gl.h>#include <GL/glext.h>[/source]
...and here is the source code in question:
[source lang="plain"]... /* load shaders. */ else if (strcasecmp (ext, "vert") == 0) { if (shader_load (name, file, GL_VERTEX_SHADER)) return ""; } else if (strcasecmp (ext, "frag") == 0) { if (shader_load (name, file, GL_FRAGMENT_SHADER)) return ""; }[/source]
I've tried manually defining everything used from glext.h which, although it seems dangerous, does compile successfully, but doesn't link properly:
[source lang="plain"]game/maps.wo:maps.c:(.text+0x4711): undefined reference to `_glCreateProgram'game/maps.wo:maps.c:(.text+0x472c): undefined reference to `_glAttachShader'game/maps.wo:maps.c:(.text+0x476d): undefined reference to `_glAttachShader'game/maps.wo:maps.c:(.text+0x477b): undefined reference to `_glLinkProgram'game/maps.wo:maps.c:(.text+0x4789): undefined reference to `_glUseProgram'game/maps.wo:maps.c:(.text+0x479c): undefined reference to `_glGetUniformLocation'game/maps.wo:maps.c:(.text+0x47bc): undefined reference to `_glUniform1fv'game/maps.wo:maps.c:(.text+0x47cf): undefined reference to `_glGetUniformLocation'game/maps.wo:maps.c:(.text+0x4805): undefined reference to `_glUniform1fv'game/maps.wo:maps.c:(.text+0x4818): undefined reference to `_glGetUniformLocation'game/maps.wo:maps.c:(.text+0x4882): undefined reference to `_glUniform4fv'game/maps.wo:maps.c:(.text+0x4895): undefined reference to `_glGetUniformLocation'...[/source]
...and so on. All of the normal gl.h functions (glVertex3f, etc) link properly.
Everything in the game is written in C, not C++, but that shouldn't be a problem. From what I've read, it looks like I need to link to drivers provided by the video card, but if that's the case, I'd need to make a separate build for every graphics card? Please, please, please, tell me that's not the case







