I am not sure why you get it, but WINGDIAPI is not a variable, it is #define for the function atrributes, like:
void WINGDIAPI glBlaBlaBla() something.
So it sounds like it fails to include windows.h or something like that.
Originally posted by rpxmaster: Be sure to include windoze.h before you include glut.h.
Hi!
Thanks, windows.h was included already.
I’m wondering if it’s a problem with the settings I’m using on my compiler (Turbo C++ 4.5). I would be interested in comparing my settings with those of others using the same platform. I’d greatly appreciate any advice you have.
>It look’s pretty ok to me, is this the gl.h that was included with the Borland compiler?
I downloaded this gl.h from the opengl.org website some time ago.
I’m thinking it may be the wrong gl.h for Borland 4.5. I just downloaded
BCC32 5.5 line compiler which includes a Borland gl.h. I’m going try
it later today when I get off work.
>the only thing that should be needed is to include windows.h before glut.h and then you >should be on your way (they say…).
>Do you think you could send me your windows.h (or wingdi.h if you have that one, it is >included from windows.h), the problem might be in there somewhere.
Sure, they’re both attached to this file.We may be on the right track here. I tried changing the compiler from one that accepts Borland Extensions to the ANSI standard. Now the errors are different, they’re in windows.h
The compiler only reports the first 26 errors I guess but I didn’t see anymore errors in gl.h (they might still be there, shifted to the bottom). The new errors are:
From here, you can download the latest version of gl.h for Borland, as well as glut32.h, glut32.lib, and glut32.dll, also for Borland.
Also, make sure you include your ANSI headers before you include windoze.h. It does make a difference which order you put your include statements. Therefore, your code should look like:
I decided to upgrade. I’m using the Borland C++ 5.5 command line compiler now. I followed the directions at http://home.clara.net/paulyg/ogl.htm#Borland
and the compiler appears to be finding everything it needs. None of the previous
errors are showing. However there are two that I’m trying to figure out how to
deal with now. Here’s what’s happening when I compile at the command line…
…
…
bcc32 program1.cpp glut32.lib
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
program1.cpp:
Error E2337 C:\Borland\BCC55\include\GL/glut.h 146: Only one of a set of overloaded functions can be “C”
Error E2015 program1.cpp 47: Ambiguity between ‘std::exit(int)’ and ‘exit(int)’
in function keyboard(unsigned char,int,int)
*** 2 errors in Compile ***
Error E2337: glut.h contains the line extern “C”, but it inlcudes gl.h&glu.h
which also declare functions as extern “C”. I’m not sure what
to do here.
Error E2015: I think the question here is whether to use exit() from Borland’s standard library or the user defined exit(). I see a prototype for exit() in glut.h, but I haven’t found where it is defined, so I don’t know which exit() function to use here[in program1.cpp].
I’m very thankful to everyone who has helped me so far.
If you include glut.h, you don’t need to include windows.h since it defines the required stuff by itself. You only need to include windows.h first if you’re only using gl.h and/or glu.h. The library error you got is probably because you’re using a lib-file in microsofts format which is not compatible with borland. Use the implib utility to get a correct version form opengl32.dll. And do a google search or check out the link above to find out how to do that.