Compiling opengl and glut

im trying tocompile opengl and glut under linux, but i can’t

gcc -L/usr/lib -I/usr/include -lGLU -lglut prueba.c -o prueba.o

what is the right way to do so?

thanks!!

You for got to include the most important library of all… the openGL library! the other two are helper library’s.

link the following:
-lGL -lGLU -lglut

I have a couple of glut examples for linux posted on my website:
www.angelfire.com/linux/nexusone/

Originally posted by fran24:
[b]im trying tocompile opengl and glut under linux, but i can’t

gcc -L/usr/lib -I/usr/include -lGLU -lglut prueba.c -o prueba.o

what is the right way to do so?

thanks!![/b]

gcc -L/usr/lib -I/usr/include -lGL -lGLU -lglut prueba.c -o prueba.o

ERROR:
/usr/lib/libglut.so: undefined reference to glXBindChannelToWindowSGIX' /usr/lib/libglut.so: undefined reference toglXCreateContextWithConfigSGIX’
/usr/lib/libglut.so: undefined reference to glXGetFBConfigAttribSGIX' /usr/lib/libglut.so: undefined reference toXGetExtensionVersion’
/usr/lib/libglut.so: undefined reference to XFreeDeviceList' /usr/lib/libglut.so: undefined reference toXQueryDeviceState’
/usr/lib/libglut.so: undefined reference to XListInputDevices' /usr/lib/libglut.so: undefined reference toglXQueryChannelDeltasSGIX’
/usr/lib/libglut.so: undefined reference to glXChannelRectSyncSGIX' /usr/lib/libglut.so: undefined reference toglXChannelRectSGIX’
/usr/lib/libglut.so: undefined reference to XFreeDeviceState' /usr/lib/libglut.so: undefined reference toXOpenDevice’
/usr/lib/libglut.so: undefined reference to glXQueryChannelRectSGIX' /usr/lib/libglut.so: undefined reference toglXGetFBConfigFromVisualSGIX’
/usr/lib/libglut.so: undefined reference to XmuLookupStandardColormap' /usr/lib/libglut.so: undefined reference toXSelectExtensionEvent’

it doesn’t find glx library, any idea?

thanks!!!

Originally posted by fran24:

it doesn’t find glx library, any idea?
thanks!!!

  1. Idea: stop cross posting, once is enough
  2. Idea: it DOES find glx, i am very sure
  3. Idea: read other threads in this forum and you will find the solution to your problem
  4. Idea: try the search function of this forum before posting a new thread

hope this helps

I think I’ve answered this question about 10 times in the last month. Look through the archives.

I compile all of my glut programs like this
g++ something.c -o something -lGL -lGLU -lglut -lm

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.