Original Post
I'm finally porting my game from Linux to Windows, and nothing from glext.h seems to be working. Under MinGW, I'm getting undefined references for just about everything:
[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 once
game/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
#endif
#include
#include
#include
#include
#include
#include
#include[/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
game/maps.wo:maps.c:(.text+0x476d): undefined reference to
game/maps.wo:maps.c:(.text+0x4789): undefined reference to
game/maps.wo:maps.c:(.text+0x47bc): undefined reference to
game/maps.wo:maps.c:(.text+0x4805): undefined reference to
game/maps.wo:maps.c:(.text+0x4882): undefined reference to
...[/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
[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 once
game/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
#endif
#include
#include
#include
#include
#include
#include
#include
...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