Using GLUT with Borland c++ 4.52

I have put the GLUT.dll and GLUT32.dll files in the windows/system directory, GLUT.lib and GLUT32.lib in the BC45/lib folder and gl.h, glut.h and glu.h in the BC45/include folder.

I cannot seem to make any of my code compile as the following error occurs many times:

Compiling SAMPLE.CPP:
Error …\BC45\INCLUDE\GL/GL.H 832: Declaration syntax error
Error …\BC45\INCLUDE\GL/GL.H 833: Variable ‘WINGDIAPI’ is initialized more than once

Am I doing something stupid or is there a problem with Borland and GLUT?

Someone please help coz I have loads of coursework to do using GLUT!!!

Make sure you include windows.h BEFORE gl/gl.h.

You can also include only gl/glut.h, gl/glut.h will automaticly include gl/gl.h and windows.h correctly. In MSVC, gl/glut.h will also add the library files you need, not sure about if this work in Borland.

Bob

I’ve had the same problem.
I created a new project according to the instructions on this site for Borland 5 and I get an linker error about BCWS32 ???
http://home.clara.net/paulyg/ogl.htm

Dear friends ,

Be patient with my English :^)

The question is very simple!

The Borland 4.52 is a -->> 16 Bit <<–
compiler. You must build your program
in a 32 Bit compiler , Like Borland 5.02 ,
beacuse OpenGL uses 32 Bit Librarys.

Very important notes :

  1. The Win32 Plataform option, in Borland
    4.5’s Targuet Express don’t works .

2)Don’t use Borland 5.00 , because
this compiler have a lot of Bugs.

  1. Use Borland 5.02 , or Borland C++ Builder.

Here is a page that I found that discusses openGL and Borland.
http://www.gnt.net/~heiman/opengl.htm

good luck!