PDA

View Full Version : Auxiliary library



Puma1140
12-02-2003, 03:39 AM
when i type the following code in visual c++ which is the classic first example in open gl
#include <windows.h>
#include <GL/gl.h>
#include <GL/glaux.h>
#include <GL/glut.h>

void main(void) {
auxInitDisplayMode(AUX_SINGLE|AUX_RGBA) ;
auxInitPosition(10,10,200,200) ;
auxInitWindow("Carré blanc") ;
glClearColor(0.0F,0.0F,0.0F,0.0F) ;
glClear(GL_COLOR_BUFFER_BIT) ;
glColor3f(1.0F,1.0F,1.0F) ;
glOrtho(-1.0,1.0,-1.0,1.0,-1.0,1.0) ;
glBegin(GL_POLYGON) ;
glVertex2f(-0.5F,-0.5F) ;
glVertex2f(-0.5F,0.5F) ;
glVertex2f(0.5F,0.5F) ;
glVertex2f(0.5F,-0.5F) ;
glEnd() ;
glFlush() ;
while ( 1 ) ;
}

the compiler provides me with the following errors:

Linking...
main.obj : error LNK2001: unresolved external symbol _auxInitWindowA@4
main.obj : error LNK2001: unresolved external symbol _auxInitPosition@16
main.obj : error LNK2001: unresolved external symbol _auxInitDisplayMode@4
Debug/main.exe : fatal error LNK1120: 3 unresolved externals


Any clue?

nexusone
12-02-2003, 04:42 AM
Make sure that you have the glaux.lib and that it is in the correct directory "/lib/"

Also you do not need to include glut.h, since this library is not being used in this example.



Originally posted by Puma1140:
when i type the following code in visual c++ which is the classic first example in open gl
#include <windows.h>
#include <GL/gl.h>
#include <GL/glaux.h>
#include <GL/glut.h>

void main(void) {
auxInitDisplayMode(AUX_SINGLE|AUX_RGBA) ;
auxInitPosition(10,10,200,200) ;
auxInitWindow("Carré blanc") ;
glClearColor(0.0F,0.0F,0.0F,0.0F) ;
glClear(GL_COLOR_BUFFER_BIT) ;
glColor3f(1.0F,1.0F,1.0F) ;
glOrtho(-1.0,1.0,-1.0,1.0,-1.0,1.0) ;
glBegin(GL_POLYGON) ;
glVertex2f(-0.5F,-0.5F) ;
glVertex2f(-0.5F,0.5F) ;
glVertex2f(0.5F,0.5F) ;
glVertex2f(0.5F,-0.5F) ;
glEnd() ;
glFlush() ;
while ( 1 ) ;
}

the compiler provides me with the following errors:

Linking...
main.obj : error LNK2001: unresolved external symbol _auxInitWindowA@4
main.obj : error LNK2001: unresolved external symbol _auxInitPosition@16
main.obj : error LNK2001: unresolved external symbol _auxInitDisplayMode@4
Debug/main.exe : fatal error LNK1120: 3 unresolved externals


Any clue?

Puma1140
12-02-2003, 05:08 AM
I have glaux.lib in the correct directory...

chowe6685
12-02-2003, 05:22 AM
you also need to link to the lib, ie
#pragma comment (lib, "glaux.lib")

I can't spell

[This message has been edited by chowe6685 (edited 12-02-2003).]