[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Difficulty in compiling OpenGL
From: |
Sagar Reddy |
Subject: |
Difficulty in compiling OpenGL |
Date: |
Tue, 28 Aug 2001 14:18:41 -0700 |
hi,
I am new to the UNIX and LINUX world. I tried to compile a simple OPENGL
file called example1.c
#include <GL/gl.h>
#include <GL/glut.h>
void display(void)
{
/* clear all pixels */
glClear (GL_COLOR_BUFFER_BIT);
/* draw white polygon (rectangle) with corners at
* (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0)
*/
glColor3f (1.0, 1.0, 1.0);
glBegin(GL_POLYGON);
glVertex3f (0.25, 0.25, 0.0);
glVertex3f (0.75, 0.25, 0.0);
glVertex3f (0.75, 0.75, 0.0);
glVertex3f (0.25, 0.75, 0.0);
glEnd();
/* don't wait!
* start processing buffered OpenGL routines
*/
glFlush ();
}
void init (void)
{
/* select clearing (background) color */
glClearColor (0.0, 0.0, 0.0, 0.0);
/* initialize viewing values */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}
/*
* Declare initial window size, position, and display mode
* (single buffer and RGBA). Open window with "hello"
* in its title bar. Call initialization routines.
* Register callback function to display graphics.
* Enter main loop and process events.
*/
int main(int argc, char** argv)
{
glutInit(&argc, argv);
//glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (250, 250);
glutInitWindowPosition (100, 100);
glutCreateWindow ("hello");
init ();
glutDisplayFunc(display);
glutMainLoop();
return 0; /* ISO C requires main to return int. */
}
on an IRIX SGI machine.
can anybody tell me the command line compile option or send me a sample
Makefile
the errors I get are
address@hidden:GTK/APPLICATIONS/opengl_2 81> gcc -o example1 example1.c
-lGLU -lGL -lXmu -lX11
ld32: WARNING 84 : /usr/lib32/libGLU.so is not used for resolving any
symbol.
ld32: WARNING 84 : /usr/lib32/libGL.so is not used for resolving any
symbol.
ld32: WARNING 84 : /usr/lib32/libXmu.so is not used for resolving any
symbol.
ld32: ERROR 33 : Unresolved text symbol "glutInit" -- 1st referenced
by /usr/tmp/cc9FQF5b.o.
Use linker option -v to see when and which objects, archives and
dsos are loaded.
ld32: ERROR 33 : Unresolved text symbol "glutInitWindowSize" -- 1st
referenced by /usr/tmp/cc9FQF5b.o.
Use linker option -v to see when and which objects, archives and
dsos are loaded.
ld32: ERROR 33 : Unresolved text symbol "glutInitWindowPosition" --
1st referenced by /usr/tmp/cc9FQF5b.o.
Use linker option -v to see when and which objects, archives and
dsos are loaded.
ld32: ERROR 33 : Unresolved text symbol "glutCreateWindow" -- 1st
referenced by /usr/tmp/cc9FQF5b.o.
Use linker option -v to see when and which objects, archives and
dsos are loaded.
ld32: ERROR 33 : Unresolved text symbol "glutDisplayFunc" -- 1st
referenced by /usr/tmp/cc9FQF5b.o.
Use linker option -v to see when and which objects, archives and
dsos are loaded.
ld32: ERROR 33 : Unresolved text symbol "glutMainLoop" -- 1st
referenced by /usr/tmp/cc9FQF5b.o.
Use linker option -v to see when and which objects, archives and
dsos are loaded.
ld32: INFO 152: Output file removed because of error.
collect2: ld returned 2 exit status
- Difficulty in compiling OpenGL,
Sagar Reddy <=