PDA

View Full Version : glext.h



JLawson
07-08-2001, 09:21 AM
okay...no matter what source codes I download, no matter what code I write and try to compile, Everything will be perfect EXCEPT that I get about 13 error messages that say "Multiple declaration of" whatever. Now, the error says that the location of the "multiple declarations" is in glext.h.... Ive reviewed and downloaded glext.h from about 20 different locations, and they are all the same. Whats going on?

Deiussum
07-09-2001, 06:23 AM
Posting specific errors and code would be pretty useful. Without that, all anyone can do is guess at what you are doing wrong.

JLawson
07-09-2001, 12:05 PM
It doesn't really matter WHAT I try and compile. Any simple "Hello world" to an advanced game will give me the same error message. "Multiple declaration of (something long and unpronouncable) in glext.h)"...oy vey..

Deiussum
07-10-2001, 04:42 AM
Ok, maybe I wasn't clear before. Cut and paste some EXACT errors. You know... something that could show us WHAT is saying that it is being delcared multiple times? Also showing some of your code so that we can see the order that you do your #includes would help. It does make a difference. (For instance if you #include <GL/gl.h>, you must #include <windows.h> first in order to get certain definitions.) Help us to help you by being as specific as you can about your errors. Offhand, I can't think of any reason glext.h would give errors because it's mostly just a bunch of #defines and function pointer declarations. The only thing I can think of w/o more information is that you have another header that does some of the same #defines as there are in glext.h. Seeing some specific errors might trigger something in the back of my mind that would allow me to diagnose your problem easier.

From another thread you created I think you said you were using Borland 3.1. That's kind of an old version, I believe. If it's an old 16-bit or DOS compiler, it may not be capable of doing OpenGL apps since you will need a compiler capable of making win32 executables.

Deiussum
07-10-2001, 05:59 AM
Ok, I downloaded the free Borland command-line tools and had a compiled OpenGL app using glut in about 10 minutes or less. Here's what I noticed, and what I had to do...

The first thing I noticed is that bcc gives the "multiple declaration" error on WINGDIAPI if you don't have windows.h included before gl.h, or if you take out the corresponding stuff in glut.h for that definition. This error is a bit misleading as it hasn't been defined at all, not that it is really a "multiple declaration."

I had to use implib to make glut32.lib, glu32.lib, and opengl32.lib. I would have had to use implib to make winmm.lib since my glut.h tries to add that to the linker, but since I didn't use that in my test app, I just commented out the pragma that links that in.

The version of glext.h that I got from nVidia had no problems as long as I included it after glut.h.

My guess is you are running into the WINGDIAPI problem that is so common to new OpenGL programers. It just takes on a bit different error message in Bcc than it does in VC++.

If you want the headers and libraries I used, I zipped them up and uploaded them to http://www.lycanth.com/OpenGL/borlandGL.zip

JLawson
07-10-2001, 11:39 AM
ya sorry about that. Heres the compilation errors I'll try:




Compiling ..\TERRA3D\LESSON18.CPP:
Error ..\INCLUDE\GLEXT.H 2773: Multiple declaration for 'PFNGLTEXCOORD2FCOLOR4FNORMAL3FVE'
Error ..\INCLUDE\GLEXT.H 2775: Multiple declaration for 'PFNGLTEXCOORD4FCOLOR4FNORMAL3FVE'
Error ..\INCLUDE\GLEXT.H 2779: Multiple declaration for 'PFNGLREPLACEMENTCODEUICOLOR4UBVE'
Error ..\INCLUDE\GLEXT.H 2781: Multiple declaration for 'PFNGLREPLACEMENTCODEUICOLOR3FVER'
Error ..\INCLUDE\GLEXT.H 2783: Multiple declaration for 'PFNGLREPLACEMENTCODEUINORMAL3FVE'
Error ..\INCLUDE\GLEXT.H 2785: Multiple declaration for 'PFNGLREPLACEMENTCODEUICOLOR4FNOR'
Error ..\INCLUDE\GLEXT.H 2787: Multiple declaration for 'PFNGLREPLACEMENTCODEUITEXCOORD2F'
Error ..\INCLUDE\GLEXT.H 2788: Multiple declaration for 'PFNGLREPLACEMENTCODEUITEXCOORD2F'
Error ..\INCLUDE\GLEXT.H 2789: Multiple declaration for 'PFNGLREPLACEMENTCODEUITEXCOORD2F'
Error ..\INCLUDE\GLEXT.H 2790: Multiple declaration for 'PFNGLREPLACEMENTCODEUITEXCOORD2F'
Error ..\INCLUDE\GLEXT.H 2791: Multiple declaration for 'PFNGLREPLACEMENTCODEUITEXCOORD2F'
Error ..\INCLUDE\GLEXT.H 2893: Multiple declaration for 'PFNGLGETFINALCOMBINERINPUTPARAME'
Error ..\INCLUDE\GLEXT.H 3093: Misplaced endif directive
Error ..\INCLUDE\GL\GLAUX.H 17: Incorrect pragma directive option: push
Error ..\INCLUDE\GL\GLAUX.H 17: Incorrect pragma directive option: -a8
Error ..\INCLUDE\GL\GLAUX.H 17: Incorrect pragma directive option: -pc
Warning ..\INCLUDE\GL\GLAUX.H 266: Style of function definition is now obsolete
Error ..\INCLUDE\GL\GLAUX.H 266: Declaration was expected
Error ..\INCLUDE\GL\GLAUX.H 268: 'auxCloseWindow' is not a parameter
Error ..\INCLUDE\GL\GLAUX.H 269: 'auxQuit' is not a parameter
Error ..\INCLUDE\GL\GLAUX.H 270: 'auxSwapBuffers' is not a parameter
Error ..\INCLUDE\GL\GLAUX.H 273: 'auxMainLoop' is not a parameter
Error ..\INCLUDE\GL\GLAUX.H 276: 'auxExposeFunc' is not a parameter
Error ..\INCLUDE\GL\GLAUX.H 279: 'auxReshapeFunc' is not a parameter
Error ..\INCLUDE\GL\GLAUX.H 282: 'auxIdleFunc' is not a parameter
Error ..\INCLUDE\GL\GLAUX.H 285: 'auxKeyFunc' is not a parameter
Error ..\INCLUDE\GL\GLAUX.H 285: Too many error or warning messages



Now I realize that some errors say \include\glext.h...I dont know if it matters, but my glext.h file is in the standard \include folder... should I move it into the \gl folder?
Yes, Its quite obvious that Im new to openGL, but not to programming. I'm learning openGL because word has it that its one of the best.

Anyway, if you want the code I was trying to compile,



#include<stdio.h>
#include<GL/glut.h>

void display(void)

{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.0,1.0,0.0);
glBegin(GL_POLYGON);
glVertex3f(2.0,4.0,0.0);
glVertex3f(8.0,4.0,0.0);
glVertex3f(8.0,6.0,0.0);
glVertex3f(2.0,6.0,0.0);
glEnd();
glFlush();

}

int main(int argc,char **argv)

{
printf("hello world\n");
glutInit(&amp;argc,argv);
glutInitDisplayMode(GLUT_SINGLE |GLUT_RGB | GLUT_DEPTH);
glutInitWindowPosition(100,100);
glutInitWindowSize(300,300);
glutCreateWindow("square");

glClearColor(0.0,0.0,0.0,0.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0,10.0,0.0,10.0,-1.0,1.0);

glutDisplayFunc(display);
glutMainLoop();

return 0;

}



and about the inclusion of windows.h; Ive tried to include it almost everywhere, and the same errors pop up....(the ones posted above)...

JLawson
07-10-2001, 11:41 AM
I have another question reguarding the glext.h file... When I try to compile it, I get these errors:



Compiling ..\..\GLEXT.H:
Error ..\..\GLEXT.H 1467: 'GLclampf' cannot start a parameter declaration
Error ..\..\GLEXT.H 1467: ) expected
Error ..\..\GLEXT.H 1468: 'GLenum' cannot start a parameter declaration
Error ..\..\GLEXT.H 1469: 'GLenum' cannot start a parameter declaration
Error ..\..\GLEXT.H 1469: ) expected
Error ..\..\GLEXT.H 1470: 'GLenum' cannot start a parameter declaration
Error ..\..\GLEXT.H 1470: ) expected
Error ..\..\GLEXT.H 1471: 'GLenum' cannot start a parameter declaration
Error ..\..\GLEXT.H 1471: ) expected
Error ..\..\GLEXT.H 1472: 'GLenum' cannot start a parameter declaration
Error ..\..\GLEXT.H 1472: ) expected
Error ..\..\GLEXT.H 1473: 'GLenum' cannot start a parameter declaration
Error ..\..\GLEXT.H 1473: ) expected
Error ..\..\GLEXT.H 1474: 'GLenum' cannot start a parameter declaration
Error ..\..\GLEXT.H 1474: ) expected
Error ..\..\GLEXT.H 1475: 'GLenum' cannot start a parameter declaration
Error ..\..\GLEXT.H 1475: ) expected
Error ..\..\GLEXT.H 1476: 'GLenum' cannot start a parameter declaration
Error ..\..\GLEXT.H 1476: ) expected
Error ..\..\GLEXT.H 1477: 'GLenum' cannot start a parameter declaration
Error ..\..\GLEXT.H 1477: ) expected
Error ..\..\GLEXT.H 1478: 'GLenum' cannot start a parameter declaration
Error ..\..\GLEXT.H 1478: ) expected
Error ..\..\GLEXT.H 1479: 'GLenum' cannot start a parameter declaration
Error ..\..\GLEXT.H 1479: ) expected
Error ..\..\GLEXT.H 1479: Too many error or warning messages


are there supposed to be that many errors?

And BTW, if I upgrade to MSVC++6.0, you think that would help? (Im sure it would).

If I havent said so before, thank you for you time and effort. It is greatly appreciated.

Deiussum
07-11-2001, 04:44 AM
Ok... that helps. I think I see where at least some of the problems are coming from. What compiler do you use? It appears to me that your compiler isn't accepting identifiers that are bigger than a certain length. (Note how ALL those multiple declaration errors are the same length?) A quick search through my glext.h for that first identifier giving an error reveals this.

Error on:
PFNGLTEXCOORD2FCOLOR4FNORMAL3FVE

Search results found these:
PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC
PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC

The bad pragma directives also point to a compiler that doesn't understand those options.

So far as the errors you got when you tried to compile just glext.h, those are what you should get since things like GLfloat are all defined in gl.h and not including that before glext.h will result in those errors.

VC++ would definitely fix your problem, but if you don't want to spend the money on it, there are many other free solutions. The free Borland command-line tools for one. Also, Cygwin, and other compilers that people here have mentioned that I have never tried before. http://www.opengl.org/discussion_boards/ubb/smile.gif

JLawson
07-11-2001, 07:10 AM
Allright thanks. I've been reading into and researching my problem lately, and ya, your right. I'm still using Borland C++3.1 (lol) and the documentation succintly reveals that the compiler wont allow long names. You said MSVC++ would solve my problems...Is it really that good? I was succeptible to my compiler in that I finally realized that it sucks, so now I'm certain I'll upgrade. I'll end up ordering MSVC++ online; Do you know of any good deals? So far, $89.99 is the best I can find.

Anyway, thanks again.

Deiussum
07-11-2001, 07:20 AM
$89.99 sounds like a pretty good deal to me. I had gotten the whole VStudio suite shortly after it came out at my college for the Academic price of $250. (That also included VB, VFoxPro, VJ++, etc.)

If you go to a college, you could probably check your college bookstore to see if they have a copy of just VC++. It really is one of the best IDEs around, though the compiler part of it isn't necessarily up-to-date on the latest ANSI/ISO standards.

JLawson
07-12-2001, 01:04 PM
Well, im not in college yet, but hey, I don't mind paying 90 bucks for it (probably around 117 including shipping).. anyway, thanks again.