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
...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'_glAttachShader'
game/maps.wo:maps.c:(.text+0x472c): undefined reference to
game/maps.wo:maps.c:(.text+0x476d): undefined reference to _glAttachShader'_glLinkProgram'
game/maps.wo:maps.c:(.text+0x477b): undefined reference to
game/maps.wo:maps.c:(.text+0x4789): undefined reference to _glUseProgram'_glGetUniformLocation'
game/maps.wo:maps.c:(.text+0x479c): undefined reference to
game/maps.wo:maps.c:(.text+0x47bc): undefined reference to _glUniform1fv'_glGetUniformLocation'
game/maps.wo:maps.c:(.text+0x47cf): undefined reference to
game/maps.wo:maps.c:(.text+0x4805): undefined reference to _glUniform1fv'_glGetUniformLocation'
game/maps.wo:maps.c:(.text+0x4818): undefined reference to
game/maps.wo:maps.c:(.text+0x4882): undefined reference to _glUniform4fv'_glGetUniformLocation'
game/maps.wo:maps.c:(.text+0x4895): 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 ![]()
🔒 Locked
Cross-platform Extensions (porting from Linux -> Windows)
Advertisement
Original Post
There is a forum for all things OpenGL.
Windows® does not export functions beyond OpenGL 1.2 or so, and any functions in later versions need to be linked dynamically via wlgGetProcAddress().
L. Spiro
Windows® does not export functions beyond OpenGL 1.2 or so, and any functions in later versions need to be linked dynamically via wlgGetProcAddress().
L. Spiro
Whoops, I'll repost this in that board. Thanks.
Edit: Blast, I guess I can't delete this thread. Either way, I've reposted this in its proper place:
http://www.gamedev.net/topic/629472-cross-platform-extensions-porting-from-linux-windows/
Edit: Blast, I guess I can't delete this thread. Either way, I've reposted this in its proper place:
http://www.gamedev.net/topic/629472-cross-platform-extensions-porting-from-linux-windows/
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement