简体   繁体   English

/ usr / bin / ld:在Makefile中找不到-lioutil

[英]/usr/bin/ld: cannot find -lioutil in Makefile

I want to do makefile as the following, but I received this error: 我想按以下方式制作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 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: cannot find -lioutil / usr / bin / ld:找不到-lioutil

collect2: error: ld returned 1 exit status Makefile:17: recipe for target 'frparse' failed make: *** [frparse] Error 1 collect2:错误:ld返回1退出状态Makefile:17:目标'frparse'的配方失败make:*** [frparse]错误1

I would appreciate it if you guide me. 如果您能指导我,我将不胜感激。

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 $<

regarding: 关于:

.c.o:
#   cc -c -O2 -mips2 $< 
    gcc -c -g $<   

The comment # must ALSO be indented via a <tab> otherwise the recipe never performs the third line 注释#必须通过<tab>缩进,否则配方永远不会执行第三行

Also, the syntax is a bit obsolete suggest: 另外,该语法有些陈旧,建议:

%.o:%.c

for the first line of the recipe 食谱的第一行

However, regarding your question: 但是,关于您的问题:

Is there actually a library file named libioutil.so in the directory: 目录中实际上是否存在一个名为libioutil.so的库文件:

/usr/local/image/lib/sgi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM