C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 03-07-2003, 05:29 AM   #1
Registered User
 
Join Date: Mar 2003
Posts: 12
linking an opengl program

hello

i have problem with linking my program.
it compiles well but when i try to link it i get following errors:

unresolved external auxInitDisplayMode referenced from c:\firstgl.cpp

unresolved external auxInitPosition referenced from c:\firstgl.cpp

unresolved external auxInitWindowA referenced from c:\firstgl.cpp

and source:

Code:
#include <windows.h>   // Standard Window header required for all programs
#include <conio.h>     // Console I/O functions
 #include <gl/glaux.h>   //AUX Library functions
#include <gl/gl.h> // OpenGL functions

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();
        }
im using borland 5.5
Attached Files
File Type: cpp firstgl.cpp (809 Bytes, 37 views)
raits is offline   Reply With Quote
Old 03-07-2003, 06:27 AM   #2
Banned
 
nickname_changed's Avatar
 
Join Date: Feb 2003
Location: Australia
Posts: 986
I do not really know anything about OpenGL but I thought that sort of stuff had to be done through a windows program?

Disregard this post if im off my scone.

~ Paul
nickname_changed is offline   Reply With Quote
Old 03-07-2003, 07:03 AM   #3
Registered User
 
Join Date: Mar 2003
Posts: 12
well, when i try to compile and link with that command:

c:\bcc32 -W firstgl.cpp

i get this error:
unresolved external 'WinMain' referenced from borland\...\lib\cow32.obj

and i have re-created opengl32.lib and glu32.lib with implib.
raits is offline   Reply With Quote
Old 03-07-2003, 10:47 AM   #4
Registered User
 
Join Date: Mar 2002
Posts: 1,595
try looking at the stuff here:

http://nehe.gamedev.net/default.asp

and here:

http://fly.cc.fer.hr/~unreal/theredbook/

The latter is more theory. The former offers practical advice and examples.
elad is offline   Reply With Quote
Old 03-07-2003, 02:23 PM   #5
Registered User
 
Join Date: Mar 2003
Posts: 12
ok thanks elad
raits is offline   Reply With Quote
Old 03-07-2003, 02:53 PM   #6
Has a Masters in B.S.
 
Join Date: Aug 2001
Posts: 2,267
link to the glaux.lib
__________________
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
no-one is offline   Reply With Quote
Old 03-08-2003, 07:24 AM   #7
Registered User
 
Join Date: Mar 2003
Posts: 12
Quote:
Originally posted by no-one
link to the glaux.lib

when i try to link it with glaux.lib i get following error

c:\borland\bc5\lib\gl\glaux.lib contains invalid omf record,type 0x21 (possibly coff)

and i downloaded new glaux.lib from
www.starstonesoftware.com/OpenGL/download.htm
raits is offline   Reply With Quote
Old 03-10-2003, 01:18 PM   #8
Has a Masters in B.S.
 
Join Date: Aug 2001
Posts: 2,267
wellll... there are several thing's i've seen on this...

and basically you need to convert your opengl libs, from coff to omf...

i've never dont this and i don't have a borland compiler, so...

this site has some info in the troubleshooting section at the bottom of the page...
http://ucsub.colorado.edu/~macklem/borland.html

if all else fails... http://www.google.com
__________________
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
no-one is offline   Reply With Quote
Old 03-11-2003, 07:13 AM   #9
Registered User
 
Join Date: Mar 2003
Posts: 12
All else fails so
thats the place where i should go now.
Quote:
Originally posted by no-one

if all else fails... http://www.google.com
and i have imported all lib's from dll's, even glut lib.And still same error.Maybe i should try it with visual c++.
raits is offline   Reply With Quote
Old 03-11-2003, 08:13 AM   #10
Registered User
 
Join Date: Mar 2003
Posts: 12
well...now i compiled it with visual c++
and thats what i got:
Linking...
Firstgl.obj : error LNK2001: unresolved external symbol __imp__glFlush@0
Firstgl.obj : error LNK2001: unresolved external symbol __imp__glClear@4
Firstgl.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
Firstgl.obj : error LNK2001: unresolved external symbol _auxInitWindowA@4
Firstgl.obj : error LNK2001: unresolved external symbol _auxInitPosition@16
Firstgl.obj : error LNK2001: unresolved external symbol _auxInitDisplayMode@4
Debug/Firstgl.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.

Firstgl.exe - 7 error(s), 0 warning(s)

any ideas?
raits is offline   Reply With Quote
Old 03-11-2003, 08:22 AM   #11
Registered User
 
Codeplug's Avatar
 
Join Date: Mar 2003
Posts: 3,903
You need to link with opengl32.lib and glaux.lib

gg

EDIT
For VC++ 6.0
Project->Settings->Link (tab): add "opengl32.lib glaux.lib" at the end of the "Object/library modules:" edit box.

Last edited by Codeplug; 03-11-2003 at 08:41 AM.
Codeplug is offline   Reply With Quote
Old 03-11-2003, 01:54 PM   #12
Registered User
 
Join Date: Mar 2003
Posts: 12
it compiles well but when i link it, it says that:
Code:
Linking...
glaux.lib : fatal error LNK1136: invalid or corrupt file
Error executing link.exe.

Firstgl.exe - 1 error(s), 0 warning(s)
i downloaded new glaux library too but still same error
raits is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dikumud maxorator C++ Programming 1 10-01-2005 06:39 AM
Date program starts DOS's date jrahhali C++ Programming 1 11-24-2003 05:23 PM
OpenGL .dll vs video card dll Silvercord Game Programming 14 02-12-2003 07:57 PM
Please could someone help me with my 8-function calculator program? Geeth Asokan C Programming 2 05-10-2002 04:16 PM
My program, anyhelp @licomb C Programming 14 08-14-2001 10:04 PM


All times are GMT -6. The time now is 01:13 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22