Setup

New to OpenGl, I’m getting errors on the Borland 55 command-line cmpilr – 'Multiple decalaration of ‘WINGDIAPI’ and similar messages… Has anyone heard of this ?

I did as follows:
glut.h, glu.h, gl.h --> \include\gl
opengl32.lib, glut32.lib, glu32.lib – \lib\
and
opengl32.dll, glut32.dll and glu32.dll
–> Win\system
isn’t that correct ?

I didn’t compile the glut. Do I have to ?
any help would be greatly appreciated…
Tia MikeH

AAH! I’ve got those same damn problems too! I keep getting “multiple declaration” errors, and I’m new to oGL also. So anything you find out, please tell me!

did you try to convert the dll’s to borland format.

Hehehe, you use the makelib.exe file that comes with Borland cpp. Then you have to create lib’s and headers for glut. If you use the standard ones it gives errors. The standard opengl libraries however work fine.
Read up on the makelib.exe to see what parameters it takes etc. I can’t remember offhand. I know it takes the dll as an argument though.

Where did you get the glut.h you are using? With the version I have, you technically don’t need to include glu.h or gl.h because the glut.h takes care of that for you. It also takes care of some other things for you. Typically, you need to include windows.h BEFORE you include gl.h becuase windows.h defines WINGDIAPI and APIENTRY, which is then used in gl.h. The version of glut.h that I got takes care of this for you with the following code…

/* GLUT 3.7 now tries to avoid including <windows.h>
to avoid name space pollution, but Win32’s <GL/gl.h>
needs APIENTRY and WINGDIAPI defined properly. */

if 0

define WIN32_LEAN_AND_MEAN

include <windows.h>

else

/* XXX This is from Win32’s <windef.h> */

ifndef APIENTRY

define GLUT_APIENTRY_DEFINED

if (_MSC_VER >= 800) | | defined(_STDCALL_SUPPORTED)

define APIENTRY __stdcall

else

define APIENTRY

endif

endif

/* XXX This is from Win32’s <winnt.h> */

ifndef CALLBACK

if (defined(_M_MRX000) | | defined(_M_IX86) | | defined(_M_ALPHA) | | defined(_M_PPC)) && !defined(MIDL_PASS)

define CALLBACK __stdcall

else

define CALLBACK

endif

endif

/* XXX This is from Win32’s <wingdi.h> and <winnt.h> */

ifndef WINGDIAPI

define GLUT_WINGDIAPI_DEFINED

define WINGDIAPI __declspec(dllimport)

endif

/* XXX This is from Win32’s <ctype.h> */

ifndef _WCHAR_T_DEFINED

typedef unsigned short wchar_t;

define _WCHAR_T_DEFINED

endif

endif

Thanks Deiussum, RedZen, Stone, JLawson – I think I got it, but I’m still not sure if it’s right. I downloaded some glut version – supposedly borland specific – from a site pointed to in an early post on this board, rnamd the .h’s, dlls and libs, and copied over them. Deiussum: I copied/pated this thread and seved it, for the makefile info, in case I do have to convert old files – (tho I didn’t really want to unless I had to, but still might). A friend sent me an opengl image but I don’t think it is shading correctly. Anyone tell me where I can get the ‘Redbook’ examples ? to test it more thoughly ? Help greatly appretiated… thanks again… MikeH

I posted a response to this thread too that might help you.
http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/004791.html