我想按如下方式执行 makefile,但收到此错误:
gcc frparse.o frtags.o frscan.o frinit.o frstop.o frfoot.o frio.o -L/usr/local/image/lib/sgi -lioutil -lutil -o frparse
/usr/bin/ld: 找不到 -lioutil
collect2:错误:ld 返回 1 退出状态 Makefile:17: 目标 'frparse' 的配方失败 make: *** [frparse] 错误 1
如果你能指导我,我将不胜感激。
IMLIB = /usr/local/image/lib/sgi
LLIBS = -lioutil -lutil
it: frparse frcheck pgrep
OBJ = frparse.o frtags.o frscan.o frinit.o frstop.o frfoot.o frio.o
frparse.o: Makefile frparse.h frio.h frproto.h frstop.h frparse.c
frinit.o: Makefile frparse.h frproto.h frinit.c
frscan.o: Makefile frio.h frstop.h frscan.c
frfoot.o: Makefile frparse.h frproto.h frstop.h frfoot.c
frtags.o: Makefile frparse.h frio.h frproto.h frstop.h frtags.c
frstop.o: Makefile frstop.h frstop.c
frio.o: Makefile frio.c
frparse: $(OBJ)
gcc $(OBJ) -L$(IMLIB) $(LLIBS) -o $@
frcheck: frcheck.o
gcc frcheck.o -L$(IMLIB) $(LLIBS) -o $@
pgrep: pgrep.o
gcc pgrep.o -L$(IMLIB) $(LLIBS) -o $@
.c.o:
# cc -c -O2 -mips2 $<
gcc -c -g $<
最佳答案
关于:
.c.o:
# cc -c -O2 -mips2 $<
gcc -c -g $<
评论#
还必须通过 <tab>
缩进否则配方永远不会执行第三行
此外,语法有点过时建议:
%.o:%.c
食谱的第一行
但是,关于您的问题:
实际上有一个名为libioutil.so
的库文件吗?在目录中:
/usr/local/image/lib/sgi
关于c -/usr/bin/ld : cannot find -lioutil in Makefile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56115425/