PDA

View Full Version : How could use glut library in C++ Builder?



linusky
03-05-2004, 06:51 PM
where should I locate the dll and header files?
How what should I do in c++ builder projects?

mikael_aronsson
03-06-2004, 04:45 AM
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

linusky
03-09-2004, 08:41 PM
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)

mikael_aronsson
03-09-2004, 10:41 PM
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

Inquisitor
03-10-2004, 08:56 AM
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.

nexusone
03-10-2004, 09:48 AM
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)

linusky
03-10-2004, 09:25 PM
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]

Inquisitor
03-11-2004, 12:30 AM
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!