Skip to main content
GameDev.net gamedev.net
🔒 Locked

Compile errors with GLee

Started by Tachikoma Apr 26, 2004 at 10:30 AM 14 replies 1.8k views
Original Post
Tachikoma
Tachikoma
I''ve been playing around with GLEE in VC++ .NET 2003, but I''m keep getting compile errors. I have a file, called common.h, which gets included in every source file in my project, and it contains all the common library headers I need, such as: //#include <GL/gl.h> //#include <GL/glu.h> #include <GL/glee.h> Since I''m using GLee, I commented out the traditional gl.h and glu.h includes (as instructed). As a test, I decided to use the glColorTableEXT() function. However, when I compile my project, VC++ gives me this error: "error C3861: ''glColorTableEXT'': identifier not found, even with argument-dependent lookup" What am I doing wrong?
benjamin bunny
benjamin bunny
Hi. glColorTableEXT is defined in glee.h. The only reason it wouldn't be defined in your program is if GL_EXT_paletted_texture was defined before glee.h was included. Look at line 3526 of glee.h to see what I mean.

[edit]
I guess the most likely reason for it not working is that you didn't put glee.h in your include\gl directory (should be [vcpath]\platformSDK\include\gl with .net 2003). [/edit]

BTW, glee.h doesn't include glu.h for you, so if you want glu functions you still need to include glu.h. If the readme says otherwise then it's a mistake.

[edited by - benjamin bunny on April 26, 2004 12:03:45 PM]
_the_phantom_
_the_phantom_
hmmm i''ve got a program which compiles and works fine on VS.Net03 with GLee in its own folder (i keep all my ''other'' SDKs in their own dirs so i dont have to much hassle on reinstalls) with my paths set to include that dir.

oh, as an aside Ben i noticed that the GLee header is missing the constant for the ATI WGL floating point buffer support, i dont have the define to hand atm or i''d paste it here
Tachikoma
Tachikoma
The glee.lib and glee.h files are located in ...\Vc7\PlatformSDK\Lib and ...\Vc7\PlatformSDK\include\gl respectively.

I''m aware that glColorTableEXT is defined in glee.h, I checked it myself before starting this topic. I also checked that GL_EXT_paletted_texture is not defined before #include <GL/glee.h>.

I even tried adding glee.h and glee.c directly into my project, and do an #include "glee.h" instead, but the compiler gives me the same errors.




[By the way, you were correct about not to comment #include <GL/glu.h> ... oops.]
benjamin bunny
benjamin bunny
quote:
Original post by Tachikoma
The glee.lib and glee.h files are located in ...\Vc7\PlatformSDK\Lib and ...\Vc7\PlatformSDK\include\gl respectively.

I''m aware that glColorTableEXT is defined in glee.h, I checked it myself before starting this topic. I also checked that GL_EXT_paletted_texture is not defined before #include <GL/glee.h>.

I even tried adding glee.h and glee.c directly into my project, and do an #include "glee.h" instead, but the compiler gives me the same errors.




[By the way, you were correct about not to comment #include <GL/glu.h> ... oops.]


Well on the face of it, you haven''t done anything wrong. However GLee definitely does work on .net 2003, so I''m pretty certain you have. Without seeing the relevant code though, I can''t tell where the problem is.

Some things you might want to do:
Check whether other GLee extension functions work. If they do, it suggests a bug with GLee rather than your code (let me know and I''ll fix it)
Setup a small test program and see if it works.
_the_phantom_
_the_phantom_
Ben : The define i mentioned that was missing, dont know if you want to include it or not :

#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 // ATI''s floating point frame/pbuffer support



afaik its returned when you query the pixel formats via the WGL_ARB_pixel_format extension
benjamin bunny
benjamin bunny
quote:
Original post by _the_phantom_
Ben : The define i mentioned that was missing, dont know if you want to include it or not :

#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 // ATI''s floating point frame/pbuffer support



afaik its returned when you query the pixel formats via the WGL_ARB_pixel_format extension


Thanks for the info. The reason it''s not included is it''s not in the latest wglext.h file on SGI.com (which glee is generated from). At some point I''ll make a modified version and generate it from that. That way, the querying variables etc should also work.
Tachikoma
Tachikoma
I made a very simple test project, just to see if it compiles at all:

#include <GL/glee.h>

void main(void)
{
char C[256*4];
glColorTableEXT(GL_TEXTURE_2D, GL_RGBA, 256, GL_RGBA, GL_UNSIGNED_BYTE, C);

}


Obviously, it''s not meant to be executed, because it has no OpenGL setup code, etc.

I still get the same error as before. For the record, before I was using GL headers and libraries provided MESA.
LizardCPP
LizardCPP
You must call GLeeInit() after you got a rendering context it says in the readme.

Edit: Are you doing that?

LizardCPP

[edited by - LizardCPP on April 27, 2004 9:43:35 AM]
benjamin bunny
benjamin bunny
quote:
Original post by Tachikoma
I made a very simple test project, just to see if it compiles at all:

#include <GL/glee.h>

void main(void)
{
char C[256*4];
glColorTableEXT(GL_TEXTURE_2D, GL_RGBA, 256, GL_RGBA, GL_UNSIGNED_BYTE, C);

}


Obviously, it''s not meant to be executed, because it has no OpenGL setup code, etc.

I still get the same error as before. For the record, before I was using GL headers and libraries provided MESA.


You did link to glee.lib, right?

BTW, if you''re using windows then it''s a good idea to use the gl 1.1 libraries that come with VC. GLee works fine with the MESA headers on Linux, but I haven''t tested it with MESA on Windows.
Tachikoma
Tachikoma
quote:
You did link to glee.lib, right?

Yeah. It''s not a linker error tho, it''s a compiler error.

quote:
BTW, if you''re using windows then it''s a good idea to use the gl 1.1 libraries that come with VC. GLee works fine with the MESA headers on Linux, but I haven''t tested it with MESA on Windows.

I disabled the MESA headers & libs, same thing.

OK, I tried this: I decided to edit glee.h and see what happens. I simply added random charactes on line 3545 (just above the #define glColorTableEXT pglColorTableEXT definition), and see if generates an error. It didn''t. It seems the compler doesn''t ''see'' the #define glColorTableEXT pglColorTableEXT definition for some reason.
Tachikoma
Tachikoma
It seems the compiler ignores everyhing in between

#ifndef GL_EXT_paletted_texture
...
...
...
#endif


Interestingly, GL_EXT_paletted_texture is not declared anywhere before #include <GL/glee.h>.
benjamin bunny
benjamin bunny
Ok, here's the reason. Like I said above, GL_EXT_paletted_texture is already defined. It's actually in gl.h. I'm not sure why this is; but it's possible it was depreciated at some point. The solution is to use the glColorTable function that is part of OpenGL 1.2 core. GLee will automatically link this function for you if your OpenGL version is >= 1.2.

BTW, the reason for this behaviour is to avoid conflicts with whatever GL header is being used. Linux headers in particular include a lot of extension functions which are already linked. The assumption is that if an extension name is defined, the functions are linked statically.

[edited by - benjamin bunny on April 27, 2004 12:18:50 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.