Compiling help

I have a problem getting my code to compile. When I type: gcc -lgtut -lMesaGL -lMesaGLU -lXmu -lXext -lXi -lX11 -lm -o outputfile kodefile.c

But I get this:
/usr/i386-slackware-linux/bin/ld: cannot find -lglut
collect2: ld returned 1 exit status

What am I going to do to fix this?

Well you probably don’t have the glut libs installed.Find the right package(assuming your distro has packages) and install it.
Hmmm, just saw you’re running Slack.I don’t know if there are any tgzs out there, check out www.slackware.com.If there aren’t you’ll have to compile.Just get the glut sources and follow the instructions in the INSTALL file,but you propably allready know this since this sort of thing is quite common in Slack boxes.Also you might want to consider using -lGL and -lGLU instead of -lMesa* especially if you get software rendering,unless of course you know better.

[This message has been edited by zen (edited 10-06-2002).]

I had installed glut, just did some small mistake and it’s ok now. But now I get the same message, just this time it is -lXmu. I get also the same message on -lXext, -lXi, and -lX11. All this libs was installed at the same time as my slackware 8.0.
Can anyone help me?

If they are installed then find where they are( probably /usr/X11R6/lib) and add the option -L [path] to gcc.For example:
gcc -L /usr/X11R6/lib -lgtut -lMesaGL -lMesaGLU -lXmu -lXext -lXi -lX11 -lm -o outputfile kodefile.c
This tells gcc to look in that path for libraries as well.It should work then.

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