Link to home
Start Free TrialLog in
Avatar of micah
micah

asked on

compiling Open GL on SGI?

I am trying to learn OpenGL on the SGI.  Anyhow I can't figure out what I need to do to compile a basic program such as

#include <GL/gl.h>
#include "aux.h"

int main(int argc, char** argv)
{
    auxInitDisplayMode (AUX_SINGLE | AUX_RGBA);
    auxInitPosition (0,0,500, 500);
    auxInitWindow(argv[0]);
   
    glClearColor(0.0, 0.0, 0.0, 0.0);
    glClear(GL_COLOR_BUFFER_BIT);
   
    glFlush();
}



I know this doesn't do anything other then use some openGL calls.  When I compile trying

cc -I./libaux sample.c

I get a bunch of link errors similar to

ld: ERROR 33: Unresolved text symbol "glClear" -- 1st referenced by sample.o.


I assume this is because I am not including the openGL libraries in my compile statement.  what are they?  what should my compile statement look like?

give my a single line that will compile the above code.

aux.h is header files from the book "OpenGL Programming Guide"  You can even omit aux.h and just give me a line that will compile a program that contains one line in the main statement
glClear(GL_COLOR_BUFFER_BIT);

Thanks
Avatar of HOIMEI
HOIMEI

You should also incliude <GL/glu.h>
Avatar of micah

ASKER

That include statement does not help at all.  I think the problem is linking with the libraries and has to do with the compile statement.  The example in the book does not include glu.h, although later ones do.  I don't think any of the statements in the above program are from glu.h.  In any case I get the same errors including glu.h
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial