erik-k
04-30-2004, 06:08 PM
Completely new to openGL here. Running Mandrake Linux on a PC with GCC.
I've got MESA installed, and it looks like I'm ready to go. The compiler doesn't seem to complain about not finding the calls I reference, but then generates a bizzare message about not being able to find some temp file
Here's the source:
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
void main(int argc, char **argv)
{
glBegin(GL_LINES);
glVertex2i(0,0);
glVertex2i(1,0);
glVertex2i(1,1);
glvertex2i(0,1);
glEnd();
}
And here's the error output:
[erik-k@erik opengl]$ gcc -o hello helloworld.c
helloworld.c: In function `main':
helloworld.c:21: warning: return type of `main' is not `int'
/home/erik-k/tmp/ccc0mOMC.o(.text+0x16): In function `main':
: undefined reference to `glBegin'
/home/erik-k/tmp/ccc0mOMC.o(.text+0x25): In function `main':
: undefined reference to `glVertex2i'
/home/erik-k/tmp/ccc0mOMC.o(.text+0x34): In function `main':
: undefined reference to `glVertex2i'
/home/erik-k/tmp/ccc0mOMC.o(.text+0x43): In function `main':
: undefined reference to `glVertex2i'
/home/erik-k/tmp/ccc0mOMC.o(.text+0x52): In function `main':
: undefined reference to `glvertex2i'
/home/erik-k/tmp/ccc0mOMC.o(.text+0x5a): In function `main':
: undefined reference to `glEnd'
collect2: ld returned 1 exit status
I have no idea what this means; The program sucessfully includes GL/gl.h, GL/glu.h, and GL/glut.h, and I can sucessfully compile and use openGL programs on my computer.
Can someone point me to an openGL tutorial for LINUX, on a PC with MESA? Just reading MAN pages won't cut it forever.
I've got MESA installed, and it looks like I'm ready to go. The compiler doesn't seem to complain about not finding the calls I reference, but then generates a bizzare message about not being able to find some temp file
Here's the source:
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
void main(int argc, char **argv)
{
glBegin(GL_LINES);
glVertex2i(0,0);
glVertex2i(1,0);
glVertex2i(1,1);
glvertex2i(0,1);
glEnd();
}
And here's the error output:
[erik-k@erik opengl]$ gcc -o hello helloworld.c
helloworld.c: In function `main':
helloworld.c:21: warning: return type of `main' is not `int'
/home/erik-k/tmp/ccc0mOMC.o(.text+0x16): In function `main':
: undefined reference to `glBegin'
/home/erik-k/tmp/ccc0mOMC.o(.text+0x25): In function `main':
: undefined reference to `glVertex2i'
/home/erik-k/tmp/ccc0mOMC.o(.text+0x34): In function `main':
: undefined reference to `glVertex2i'
/home/erik-k/tmp/ccc0mOMC.o(.text+0x43): In function `main':
: undefined reference to `glVertex2i'
/home/erik-k/tmp/ccc0mOMC.o(.text+0x52): In function `main':
: undefined reference to `glvertex2i'
/home/erik-k/tmp/ccc0mOMC.o(.text+0x5a): In function `main':
: undefined reference to `glEnd'
collect2: ld returned 1 exit status
I have no idea what this means; The program sucessfully includes GL/gl.h, GL/glu.h, and GL/glut.h, and I can sucessfully compile and use openGL programs on my computer.
Can someone point me to an openGL tutorial for LINUX, on a PC with MESA? Just reading MAN pages won't cut it forever.