PDA

View Full Version : Compiling Problems, Borland C++ 5.02



11-12-2000, 02:22 PM
I am working throught the OpenGL Superbible's AUX section...it says I have to...
"To build this program, you need to set your compiler and link options to build a Win32 console (or
text-based) application. You will need to link to the AUX library glaux.lib and the OpenGL import library
opengl32.lib. See your compilerís documentation for individual instructions on building console
applications."

I setup a new project with the options:
-Platform: Win32
-Target Model: Console
-Node: .c
*nothing else selected

I now insert this Code
"
#include <windows.h> // Standard Window #include <conio.h> // Console I/O functions
#include <gl\gl.h> // OpenGL functions
#include <gl\glaux.h> // AUX Library

void main(void)
{
// These are the AUX functions to set up the window
auxInitDisplayMode(AUX_SINGLE | AUX_RGBA);
auxInitPosition(100,100,250,250);
auxInitWindow("My first OpenGL Program");
// These are the OpenGL functions that do something in the window
glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glFlush();

// Stop and wait for a keypress
cprintf("Press any key to close the Window\n");
getch();
}
"

When I try and build the project I get a Linking error
" Fatal: Unable to open file 'filename.def' "

Anybody know what am I doing wrong?

Many thanks
HD

Spaceman
11-13-2000, 06:19 AM
Check out the projecttree and delete the filename.def entry


-------------------- www.oglpp.de (http://www.oglpp.de)
German OpenGL Programming Page

11-13-2000, 10:23 AM
Thx, Yup that got rid of that error, however I am now getting 3 Link errors (heres the new error
)
"Info :test.cpp: output file test.obj does not exist
Info :Compiling C:\Temp\OpenGL Programs\test.cpp
Info :Linking C:\Temp\OpenGL Programs\test.exe
Error: Error: Unresolved external 'auxInitDisplayMode' referenced from C:\TEMP\OPENGL PROGRAMS\TEST.OBJ
Error: Error: Unresolved external 'auxInitPosition' referenced from C:\TEMP\OPENGL PROGRAMS\TEST.OBJ
Error: Error: Unresolved external 'auxInitWindowA' referenced from C:\TEMP\OPENGL PROGRAMS\TEST.OBJ
"

Any Ideas?

Deiussum
11-13-2000, 11:51 AM
You need to add the glaux.lib to your project. If you're using VC++ you do that by going to Project->Settings->Link tab->External libraries (or something to that effect, I don't have access to VC++ right now to check the exact text.)

11-15-2000, 09:15 AM
Build the .lib file using the program implib.exe thusly:
implib glaux.lib glaux.dll