Make: /usr/bin/ld: cannot find -lXmu

I have a make file the following is a part of this make file.

[b]############## Makefile ################################
NCDIR = /usr/include/
LIBDIR = /usr/lib/

GL_LIB = libGL.so
GLU_LIB = libGLU.so
GLUT_LIB = libglut.so

CC=gcc

CFLAGS = -O3 -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DFX

XLIBS = -L/usr/X11/lib -L/usr/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE

GL_LIBS = -L$(LIBDIR) -lglut -lGLU -lGL -lm $(XLIBS)

LIB_DEP = (LIBDIR)/(GL_LIB) (LIBDIR)/(GLU_LIB) (LIBDIR)/(GLUT_LIB)

PROGS = packpic1 ReadInitialFiles

RULES

.SUFFIXES:
.SUFFIXES: .c .o

.c: (LIB_DEP) (CC) -I$(INCDIR) (CFLAGS) < (GL_LIBS) -o @
############## end of Makefile ################################[/b]
I cannot finish make this Make file, this is the output for this Makefile:
[Shan@localhost scooppic]$ make scooppic
gcc -I/usr/include/ -O3 -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DFX scooppic.c -L/usr/lib/ -lglut -lGLU -lGL -lm -L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -o scooppic
scooppic.c:10:1: warning: C++ style comments are not allowed in ISO C90
scooppic.c:10:1: warning: (this will be reported only once per input file)
In file included from scooppic.c:15:
InitVars.c:16:3: warning: C++ style comments are not allowed in ISO C90
InitVars.c:16:3: warning: (this will be reported only once per input file)
In file included from scooppic.c:16:
ReadInitialFile.c:50:3: warning: C++ style comments are not allowed in ISO C90
ReadInitialFile.c:50:3: warning: (this will be reported only once per input file)
In file included from scooppic.c:18:
DrawObjects.c:59:5: warning: C++ style comments are not allowed in ISO C90
DrawObjects.c:59:5: warning: (this will be reported only once per input file)

[b]/usr/bin/ld: cannot find -lXmu
collect2: ld returned 1 exit status

For the last two lines, there is an error for: /usr/bin/ld: cannot find –lXmu.[/b]
I have no idea where to go. I would be grateful for any help you could provide.

for Debian: apt-get install libxmu-dev
for Mandriva: urpmi libXmu-devel

Don’t remember the command for other distros. Google for it and for the package name.

Tip : search tis error mesage on google you will find lots of solutions, only trick is to put quotes around the -Xmu, like this :

/usr/bin/ld: cannot find “-lXmu”

Good tip! Knew about minus search negation. Didn’t know about quote escape.

And the quotes just needed to keep Google from interpreting the leading minus as a search negation (i.e. make sure it “doesn’t” match this).

Thank you so much. I do like this:

yum install libXmu-devel

and now it works! o(∩_∩)o

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