Need help setting up GLUT!!!!

i posted a previous message reguarding this problem but people claimed to need more info.
So here it is. These are the error messages when i try to compile it:

Microsoft® Windows 98
©Copyright Microsoft Corp 1981-1998.

C:\WINDOWS\Desktop>cd\

C:>cd borland\bcc55\bin

C:\Borland\bcc55\Bin>bcc32 c: est.cpp
Borland C++ 5.5 for Win32 Copyright © 1993, 2000 Borland
c: est.cpp:
Turbo Incremental Link 5.00 Copyright © 1997, 2000 Borland
Error: Unresolved external ‘glutInitDisplayMode’ referenced from C:\BORLAND\BCC5
5\BIN\TEST.OBJ
Error: Unresolved external ‘glutCreateWindow’ referenced from C:\BORLAND\BCC55\B
IN\TEST.OBJ
Error: Unresolved external ‘glutDisplayFunc’ referenced from C:\BORLAND\BCC55\BI
N\TEST.OBJ
Error: Unresolved external ‘glutMainLoop’ referenced from C:\BORLAND\BCC55\BIN\T
EST.OBJ

C:\Borland\bcc55\Bin>

and this is my c++ code:

#include <windows.h>
#include <gl/glut.h>

void RenderScene(void)
{
glClear(GL_COLOR_BUFFER_BIT);

 glFlush();

}
void SetupRC(void)
{
glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
}
void main(void)
{
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutCreateWindow(“Simple”);
glutDisplayFunc(RenderScene);

 SetupRC();

 glutMainLoop();

}

i have all the GLUT files on a cd that was included with the “OpenGL Superbible” which i purchased but i don’t know where to put them.
I would appreciate any reply to this dumb message since i’m stupid and white cause i need all the help i can get.

From a poor white kid from the hood called
Y-T.

i need help with setting up glut…

Take a look at this page on my website :

http://home.clara.net/paulyg/compfree.htm

This works good luck

#include <gl/glut.h>
#include <gl/gl.h> // Header File For The OpenGL32 Library
#include <gl/glu.h> // Header File For The GLu32 Library
#include <gl/glaux.h> // Header File For The GLaux Library
#include <stdio.h>

#pragma comment (lib, “glaux.lib”) /* link with Win32 GLUT lib */

void DrawPoly(void)
{
glBegin (GL_QUADS);
glVertex3f (-10.0f, -10.0f, -20.0f);
glVertex3f (10.0f, -10.0f, -20.0f);
glVertex3f (10.0f, 10.0f, -20.0f);
glVertex3f (-10.0f, 10.0f, -20.0f);
glEnd();

}

void init(void)
{
LoadGLTextures();
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);
}

void display(void)
{
glClear (GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glLoadIdentity ();
DrawPoly();
glFlush ();
}

void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glFrustum (-1.0, 1.0, -1.0, 1.0, 1.0, 2000.0);
glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();
}

int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_ALPHA |GLUT_DEPTH);
glutInitWindowSize (width, height);
glutInitWindowPosition ( x, y);
glutCreateWindow (argv[0]);
init ();
glutReshapeFunc(reshape);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}

You problem may be about the library.

You didn’t tell your compiler where to find
glut****() .

add glut32.lib to your link path

Well, my first recomendation is this:

If you are using Borland, that’s doesn’t have MFC, why not test MinGW?

MinGW (www.mingw.org) is other compiler, greater than Borland’s BCC, free (really free…) and is portable (uses GCC from UNIX).

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

About your question, you only need add glut32.lib in your compiler “lib” directory and copy glut.h in the compiler’s include/gl directory.

I have had the same problem and just solved it about 10 min ago.

from what I understand there are two major competing formats for the distribution of LIB’s OMF and COFF. Suffice it to say the format of you lib is incompatiable with borland’s compiler. The solution to your problem would be to download the orignal dll’s and use borland’s implib utility to convert them to a compatible format.

go to the main Opengl.org page, go to downloads and download the header files for glut (that is if you do not have these already). Include in these files you will find the dll’s, these are what you want to extract. Once extracted you want to convert them to lib’s:
something like - implib glut.lib glut.dll- will do. Next place these files in the respective directories - borland’s library directory- and then you should be all set.

Another note this article was helpful “Under the Hood” its from microsoft press. To retrive it go to Technical documentation | Microsoft Learn
in the table of contents on the left scroll to -> periodicals-> periodicals 1996-> MSJ-> March

This expains a little about the coff and omf formats.

Thanx alot KM!!! i’ve been trying to set up GLUT for the past month! now i can finally start using opengl. I did exacly what u said and it worked the first time i tried it!

Thanx,

Y-T

Originally posted by ASK:

MinGW (www.mingw.org) is other compiler, greater than Borland’s BCC, free (really free…) and is portable (uses GCC from UNIX).
[/b]

err… forgive me for mentioning but Borland’s command line compiler is completely free as well. As for portability, the compiler you use isn’t going to help you with that, thats down to the programmer. I have no problems porting code between Irix, Linux and Win32, and I’m a mere borland user…