-   Linux - Software (
-   -   Compiling a simple Mesa/GLUT program (

Bojdom 02-02-2003 12:40 AM

Compiling a simple Mesa/GLUT program
I've just installed Mesa-5.0 on my slackware 8.1 computer and I'm trying to compile one of the sample programs (hello.c).

First I tried to compile with:

gcc -o hello hello.c

and got more than 20 "undefined reference to" messages

Then I figured out that I needed to link some libraries so I tried to put some options:

gcc -o hello -lglut -lGLU -lGL -lm hello.c

This time the compiler gave me "only" two errors

/tmp/ccwCtdPK.o: In function `display':
/tmp/ccwCtdPK.o(.text+0xa7): undefined reference to `glvertex3f'
/tmp/ccwCtdPK.o(.text+0xce): undefined reference to `glvertex3f'
collect2: ld returned 1 exit status

It seems to me that the compiler still miss some library, but I don't know which one. Any ideas?

Tinkster 02-02-2003 02:16 PM


gcc -o hello -lglut -lGLU -lGL -lm hello.c
Geting there m8 :}
All you need is to -L/path/to/atual/lib


Bojdom 02-02-2003 05:19 PM

I had rewritten the program to understand how it works. And instead of glvertex3f it should be glVertex3f. :rolleyes:

Stupid me!

Thanks :)

All times are GMT -5. The time now is 06:43 AM.