PDA

View Full Version : make: /usr/bin/ld: cannot find -lXmu



shanshan
11-05-2011, 07:41 PM
I have a make file the following is a part of this make file.

############## 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 ################################
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)

/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.
I have no idea where to go. I would be grateful for any help you could provide.

_arts_
11-06-2011, 02:20 AM
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.

ZbuffeR
11-06-2011, 02:31 AM
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"

Dark Photon
11-06-2011, 10:09 AM
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).

shanshan
11-08-2011, 09:39 AM
Thank you so much. I do like this:
# yum install libXmu-devel
and now it works! o(&amp;#8745;_&amp;#8745;)o