PDA

View Full Version : I NEED MENTAL HELP!!! I need to set up GLUT but i can't figure out how dammit



Y-T
06-09-2000, 01:29 PM
i recently bought the "OpenGL Superbible" book and it gives a short program. It says to install certain dll files of glut in various directories. I did exacly what it said but when i try to compile it give me these errors:

Microsoft(R) Windows 98
(C)Copyright Microsoft Corp 1981-1998.

C:\WINDOWS\Desktop>cd\

C:\>cd borland\bcc55\bin

C:\Borland\bcc55\Bin>bcc32 c:\test.cpp
Borland C++ 5.5 for Win32 Copyright (c) 1993, 2000 Borland
c:\test.cpp:
Turbo Incremental Link 5.00 Copyright (c) 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>


===================
Now here's 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();
}
================================
PPPPLLLLLLZZZZZ help me!!!!

bigT
06-09-2000, 01:55 PM
You are getting these errors, because all you calls to glut are unkown. You have to add a static run time library so your program knows where these functions are.
In MSC++ you can add these in the settings box, but I'm not sure if how Borland C does this.
Try reading help files on how the add static library files to your program. This will elimate your errors.

06-10-2000, 01:34 AM
I have the same problem and I'm also using Borland C++ Builder. Can you please give us the name of this static runtime library under Microsoft's C++ Builder??? I added some libraries to my project, but it still doesn't work.

THX...

SysCoKid
06-10-2000, 08:26 AM
The name of library is glut32.lib,Glut32.dll must be placed in \windows\system
Another problem is that Borlan C and Visual C
libs are incompatible (i think),if so you most download glut sources from www.sgi.com\software\opengl (http://www.sgi.com\software\opengl) and recompile them

06-10-2000, 07:36 PM
you have to add the directory gl to borlands
include directory and add the appropriate
header files in this case glut.h
that should do it