(newbie) Problems getting OpenGL programs to work under linux

(newbie) Problems getting OpenGL programs to work under linux

Post by Tom » Sat, 17 Nov 2001 06:57:12



I'm trying to get myself set up to use OpenGL (Mesa 4.0) under Linux.
I've used the command line

  gcc -o Hello Hello.c -lglut -lGL -lGLU

like I would generally think would work for an OpenGL link, and I get
some unresolved externals on sqrt, floor, and ceil.  I played around
with it a little, winding up with the line

  gcc -o Hello Hello.c -lglut -lGL -lGLU -lXpcs

and it compiled, but the program doesn't run.  It tells me the shared
library for Xpcs is missing.  

What the hell is Xpcs?  Why do I need it?  Is there anything I'm
obviously doing wrong here that I can fix to make this work?
--
"Don't believe the florist when he tells you that the roses are free"

Tom

 
 
 

(newbie) Problems getting OpenGL programs to work under linux

Post by Steinar H. Gunderso » Sat, 17 Nov 2001 07:16:51



>   gcc -o Hello Hello.c -lglut -lGL -lGLU -lXpcs

> and it compiled, but the program doesn't run.  It tells me the shared
> library for Xpcs is missing.  

Try using -lm instead of -lXpcs. libm is the general maths library,
containing just the stuff you need. To be honest, I haven't got a clue about
what libXpcs is supposed to be ;-)

/* Steinar */
--
Homepage: http://www.sesse.net/

 
 
 

(newbie) Problems getting OpenGL programs to work under linux

Post by Tom » Sat, 17 Nov 2001 07:45:42




> >   gcc -o Hello Hello.c -lglut -lGL -lGLU -lXpcs

> > and it compiled, but the program doesn't run.  It tells me the shared
> > library for Xpcs is missing.

> Try using -lm instead of -lXpcs. libm is the general maths library,
> containing just the stuff you need. To be honest, I haven't got a clue about
> what libXpcs is supposed to be ;-)

> /* Steinar */
> --
> Homepage: http://www.sesse.net/

thanks a alot!  that worked.  Now, to start that 3D engine I've been
meaning to write.... :)

--
"Don't believe the florist when he tells you that the roses are free"

Tom

 
 
 

(newbie) Problems getting OpenGL programs to work under linux

Post by fungu » Sat, 17 Nov 2001 07:04:51



> I'm trying to get myself set up to use OpenGL (Mesa 4.0) under Linux.
> I've used the command line

>   gcc -o Hello Hello.c -lglut -lGL -lGLU

> like I would generally think would work for an OpenGL link, and I get
> some unresolved externals on sqrt, floor, and ceil.

You forgot "-lm" - the maths library.

--
<\___/>
/ O O \
\_____/  FTB.