PDA

View Full Version : GLUT compiling error on Borland c++ 5.02



ro
06-13-2003, 12:08 PM
I have tried to configure Borland c++ 5.02 for GLUT/OpenGL. I use Windows 2000 pro OS. As I try to compile I get the warning message
"GLUT.H (486,22): Cannot create pre-compiled header: code in header" and the error message "test.cpp (245,19): Call to undefined function 'glBindTexture'". Are these messages related, and do anyone have any idea on how to solve the problem?
ro

mdog1234
06-13-2003, 12:33 PM
dont use borland

Rob The Bloke
06-15-2003, 08:37 AM
go here and download the binaries.
http://www.xmission.com/~nate/glut.html

upon opening the zip you will see a file called "README-win32.txt". If you read that file (which is why it was written), there is a little section that already answers your question......

[ README usually means just that.... ]

================================================== =========

BORLAND NOTES:

From what I understand, Borland supplies a utility that
converts Microsoft Visual C++ .libs into Borland compatible
files. Therefore, the best method for Borland users is
probably to get the precompiled versions of the library and
convert the library. To create an import library for Borland
from the DLLs, use the following command (from a command prompt):
IMPLIB glut32.lib glut32.dll
If IMPLIB crashes when called this way, try
IMPLIB glut32.lib glut.def
using the glut.def file in this distribution.

================================================== =========

Now assuming your version of borland is set up, all you need to do is what it says, ie type the line (!!IN THE DIRECTORY WHERE YOU EXTRACTED THE GLUT BINARIES!!):

IMPLIB glut32.lib glut32.dll

or

IMPLIB glut32.lib glut.def

that will produce glut32.lib. viola.

Put glut.h in borlands /include/GL/ folder, put glut32.lib in borlands /lib/ folder, and put glut32.dll in your windows/system32/ folder.

compile your glut progs with

bcc32 -eMyProgramName.exe main.c

If you get loads of errors about WINAPI being undefined then add the following flag to the command line :

-DWIN32

The openGL and glut libraries should automatically link because of the following lines in glut.h :

#pragma comment (lib, "opengl32.lib")
#pragma comment (lib, "glu32.lib")
#pragma comment (lib, "glut32.lib")

Some compilers may not support that, I believe borland does, however if you get lots of Unresolved external errors then you will probably have to add the names of the 3 GL libs to the end of your command line.

you may get some wierd glutAtExit hack errors when you compile. If you do add the following to your command line options :

-DGLUT_DISABLE_ATEXIT_HACK

Rob The Bloke
06-15-2003, 08:41 AM
You might also want to download a newer version of the Borland compiler 5.55, if you run a search you should be able to find the pre-compiled versions of DirectX8 for Borland. You can then have joypads, sounds etc...

heiman
06-16-2003, 11:30 AM
The following link may help
http://www-users.york.ac.uk/~rpf1/glut.html

regards,
Scott