How could use glut library in C++ Builder?

where should I locate the dll and header files?
How what should I do in c++ builder projects?

glut can be downloaded from lots of places, you can find them with google pretty easy.

Just add the library to your project like you would with any other .lib file and make sure you setup the path so it will find your header files, if you don’t have documentation for the IDE have a peek around in the project settings, there should be some place where you can setup the path to libraries and includes files to use.

Mikael

Is it right that I copy gult.h to include and copy glut.lib and glut32.lib to lib only?
If I run the project, the IDE says [Linker Error] ‘C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\GLUT32.LIB’ contains invalid OMF record, type 0x21 (possibly COFF)

Hi !

Is it an old C++ builder ? it sounds like it doesn’t like the lib file (unless it is corrupted in some way), I am not sure if MS has messed around with the .lib file format in later versions, that’s possible.

You could always locate another website to download glut from and see if it works better with another .lib file (amybe an older one).

Sorry, I don’t know anything about C++builder, anyone that knows anything about this ?

Mikael

Seems like the lib is in the wrong format.
Use implib.exe (you find it in borland’s bin directory) to create a correct one:

implib glut32.lib glut32.dll

or similar.

Sound like you downloaded the library files for GLUT under MS visual C++.

You will have to ether download the GLUT librarys for Borland or use a tool which I think is shipped with Borland to convert and VC library to a Borland compatible library.

Originally posted by linusky:
Is it right that I copy gult.h to include and copy glut.lib and glut32.lib to lib only?
If I run the project, the IDE says [Linker Error] ‘C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\GLUT32.LIB’ contains invalid OMF record, type 0x21 (possibly COFF)

And I have used implib to convert the lib files.
But IDE still reports a error .

[Linker Error] Unresolved external ‘_glutSolidSphere’ referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\OPENGL 640480 PROJECTS FOR GLUT\MAIN.OBJ

[/b][/QUOTE]

Well, I tried it out and it works as expected.
The error you report can only happen if
your protoype definition in the glut header
file is invalid.
The calling convention must be __stdcall.
It sounds like yours is cdecl.
Normally the protoype for glutSolidSphere
should be

void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);

where APIENTRY is defined as __stdcall.
Hope it helps!