Solved

compiling Open GL on SGI?

Posted on 1998-10-30
3
475 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:micah
3 Comments
 

Expert Comment

by:HOIMEI
Comment Utility
You should also incliude <GL/glu.h>
0
 

Author Comment

by:micah
Comment Utility
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
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
Comment Utility
   cc -I./libaux -lGL -lgl sample.c
or
    cc -I./libaux -lGL -lgl_s sample.c
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now