Archived

This topic is now archived and is closed to further replies.

styles_b

problems compiling extensions in VS .Net

Recommended Posts

I''m just starting out into the world of extensions, I have both Visual Studio 6.0 and Visual Studio .Net. I went over the moving beyond OpenGL 1.1 tutorial (on this website), and I can''t get it to compile in .Net. After hours of getting nowhere with errors that seem to say the glext.h defines are not being defined, I decided to try compiling the program in VC 6. It compiled fine first try. I have the exact same glext.h and wglext.h files (gl and all the other .h files needed) in my gl folder like they should be in .Net. The compiler error I seem to be getting is that various things that should be defined in glext.h (like PFNGLCLIENTACTIVETEXTUREARBPROC or PFNGLMULTITEXCOORD2FARBPROC) are not being defined. It doesn''t make sense to me that the only difference between the version that I can compile and the one that I can''t is the version of Visual Studio. I know my glext.h etc files are in the right place, as I''ve used glut, glui etc for years. Has anyone else out there ran into this problem that can shed some light on what should be a simple copy, paste, compile to get started?

Share this post


Link to post
Share on other sites
I agree with LousyFreak . With GLee you don''t need glext.h, wglext.h etc, so it shouldn''t be a problem.

But I''m surprised your code isn''t working on VC7. I recently upgraded from VC6 too, and I didn''t have any problems, except a few warnings about signed/unsigned integers. I assume you put glext.h etc in VC7/platform SDK/include/gl, rather than just VC7/include/gl?

____________________________________________________________
www.elf-stone.com | Automated GL Extension Loading: GLee 2.00 for Win32 and Linux

Share this post


Link to post
Share on other sites
Allright, so now I''m even more confused. Thanks for the suggestions, I do have the glext.h in the correct place (VC7/platform SDK/include) and I put it in the other include dir just in case (I''m getting desperate at this point). But I decided to try compiling the same program in my college lab and I had no problem compiling it in VS .Net there. I''m totally baffeled as to why this doesn''t work at home, it appears that it''s simply not doing the defining (I tried GLee and it has the same problems). The compiler errors returned are things like term does not evaluate to a function (like the function is undefined) or missing ; before identifier (because it doesn''t recognize the identifier). So it''s including the extension headers, but it seems to be simply not defining things correctly, and it''s not like I changed the source code at all. Anyone have an idea what might make my compiler behave like this?

Share this post


Link to post
Share on other sites
Okay, mind you none of it is my code
When I go to compile, it points to various functions that it says do not evaluate to a function. One is:

pglActiveTexture(GL_TEXTURE1_ARB);

This function is declared as type:
PFNGLCLIENTACTIVETEXTUREARBPROC pglActiveTexture;

The compiler gives an error on declaration line as well, syntex error mission ; Which means that that type has not been declared. So I know that my glext.h file is being included correctly, and I believe the declaration for that type is on the line:

typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);

in gltext.h. So it seems if for some reason the compiler isn''t defining the function type. The ifndef this function typedef declaration is in is:

#ifndef GL_ARB_multitexture

So my only guess is that it is simply skipping over defining this function, though there are no other places that GL_ARB_multitexture is defined. It really makes no sense to me, as I can get the exact same code, w/ the exact same headers to work in VS6, it seems like it has to be the compiler or properties or something that is making it skip over this section of code. Please let me know if you have any suggestions as to where I''m going wronge or if you need more examples. Tks

Share this post


Link to post
Share on other sites
Can you post the bit of code where you include gl.h, glext.h etc? In fact, if it's only one little file, post the whole program.

Given the information you've given us, the only thing I can think of is you're using the wrong GL header, and that is causing problems with glext.h, because it's already defined certain extension names (like GL_ARB_multitexture for example). Make sure you're using Microsoft's OpenGL 1.1 gl.h.

[edited by - benjamin bunny on November 17, 2003 9:05:46 PM]

Share this post


Link to post
Share on other sites
You are the man! I was using the correct gl.h 1.1 in my VC7/platform SDK/include/gl folder, but not in the VC7/include/GL (which I didn''t think VS defaulted to!). I updated that gl.h file to 1.1 instead of 1.2 that somehow got in their and it built. From what I understood the standard include <> meant the platform SDK folder, but apparently it doesn''t for me (I haven''t messed w/ anything that would change where the standard looks either). Anyways, it works now and I can live happily ever after, thanks for the help!

Share this post


Link to post
Share on other sites