![]() |
| | #1 |
| Registered User Join Date: Mar 2003
Posts: 12
| linking an opengl program 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();
}
|
| raits is offline | |
| | #2 |
| Banned 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 | |
| | #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 | |
| | #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 | |
| | #5 |
| Registered User Join Date: Mar 2003
Posts: 12
| ok thanks elad |
| raits is offline | |
| | #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 | |
| | #7 | |
| Registered User Join Date: Mar 2003
Posts: 12
| Quote:
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 | |
| | #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 | |
| | #9 | |
| Registered User Join Date: Mar 2003
Posts: 12
| All else fails so thats the place where i should go now. Quote:
| |
| raits is offline | |
| | #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 | |
| | #11 |
| Registered User 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 | |
| | #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) |
| raits is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
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 |