Solved

compiling Open GL on SGI?

Posted on 1998-10-30
3
493 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 100 total points
ID: 1253907
   cc -I./libaux -lGL -lgl sample.c
or
    cc -I./libaux -lGL -lgl_s sample.c
0

Featured Post

Independent Software Vendors: 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

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…
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…
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.

718 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