Solved

compiling Open GL on SGI?

Posted on 1998-10-30
3
479 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
ID: 1253905
You should also incliude <GL/glu.h>
0
 

Author Comment

by:micah
ID: 1253906
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
ID: 1253907
   cc -I./libaux -lGL -lgl sample.c
or
    cc -I./libaux -lGL -lgl_s sample.c
0

Featured Post

Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
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.

867 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

16 Experts available now in Live!

Get 1:1 Help Now