问题linker input file unused because linking not done

来源:互联网 发布:最近流行的网络歌手 编辑:程序博客网 时间:2024/06/05 22:34

> When I try to compile using the makefile, it gives me the 

> error : >>make > gcc -Wall -c client1.c > gcc -Wall -c -lsocket -lnsl libfile1.c > gcc: -lsocket: linker input file unused because linking not done > gcc: -lnsl: linker input file unused because linking not done > ar -crvs libshm.a libfile1.o > r - libfile1.o > ar: writing libshm.a > gcc -Wall client1.o -L. -lshm -o client1  > Can anybody tell me what the "linker input file unused cus linking not > done " error means ??????????  In the command for this target: libshm.a : libfile1.o     gcc -Wall -c -lsocket -lnsl libfile1.c  you're compiling only because you have the -c flag. No linking takes place, so gcc is informing you that it is ignoring the -lsocket and -lnsl linker flags. You don't need them in that command.  All of the linking takes place in the command for this target: client1: client1.o libshm.a     gcc -Wall client1.o -L. -lshm -o client  Here you will want to use -lsocket and -lnsl because you're linking all of the parts into an executable, so you can't leave anything out.
原创粉丝点击