View Full Version : Need help setting up GLUT!!!!

06-08-2000, 11:10 AM
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(R) Windows 98
(C)Copyright Microsoft Corp 1981-1998.


C:\>cd borland\bcc55\bin

C:\Borland\bcc55\Bin>bcc32 c:\test.cpp
Borland C++ 5.5 for Win32 Copyright (c) 1993, 2000 Borland
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'glutInitDisplayMode' referenced from C:\BORLAND\BCC5
Error: Unresolved external 'glutCreateWindow' referenced from C:\BORLAND\BCC55\B
Error: Unresolved external 'glutDisplayFunc' referenced from C:\BORLAND\BCC55\BI
Error: Unresolved external 'glutMainLoop' referenced from C:\BORLAND\BCC55\BIN\T


and this is my c++ code:

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

void RenderScene(void)

void SetupRC(void)
glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
void main(void)
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);



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

06-08-2000, 11:17 AM
i need help with setting up glut...

06-08-2000, 12:59 PM
Take a look at this page on my website :


06-08-2000, 03:08 PM
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);


void init(void)
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);

void display(void)
glColor3f (1.0, 1.0, 1.0);
glLoadIdentity ();
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);
glutInitWindowSize (width, height);
glutInitWindowPosition ( x, y);
glutCreateWindow (argv[0]);
init ();
return 0;

06-08-2000, 07:06 PM
You problem may be about the library.

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

add glut32.lib to your link path

06-12-2000, 12:17 AM
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.

06-17-2000, 09:58 PM
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 msdn.microsoft.com/library
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.

06-18-2000, 05:42 AM
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!



Rob The Bloke
06-21-2000, 03:17 PM
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).

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....