?
Solved

compiling Open GL on SGI?

Posted on 1998-10-30
3
Medium Priority
?
499 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 200 total points
ID: 1253907
   cc -I./libaux -lGL -lgl sample.c
or
    cc -I./libaux -lGL -lgl_s sample.c
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses

752 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