未找到链接器路径
目前,我正在Windows 10上使用GNUWIN32 RPCGEN工具。我的文件已编译,我可以为客户端和服务器生成.o文件。但是它在链接过程中失败。我正在通过make -f makefile来跟随makefile。我在Windows上使用Cygwin工具。
# Compiler flags
CC = gcc
CFLAGS += -g
LDLIBS += -lnsl
RPCGENFLAGS =
我会遇到以下错误:
$ gcc -g -o ipg_rpc_client ipg_rpc_clnt.o ipg_rpc_client.o ipg_rpc_xdr.o -lnsl
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lnsl: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile.ipg_rpc:41: ipg_rpc_client] Error 1
请帮助解决此错误。从上周开始,我一直在努力。
Currently I am working on GnuWin32 rpcgen tool on Windows 10. My files get compiled and I am able to generate .o files for client and server. But It fails in the linking process. I am running following makefile by make -f Makefile. I am using cygwin tool on windows.
# Compiler flags
CC = gcc
CFLAGS += -g
LDLIBS += -lnsl
RPCGENFLAGS =
I am getting following error:
$ gcc -g -o ipg_rpc_client ipg_rpc_clnt.o ipg_rpc_client.o ipg_rpc_xdr.o -lnsl
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lnsl: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile.ipg_rpc:41: ipg_rpc_client] Error 1
please help in solving this error. From last week I am struggling on this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后,错误解决了。
我已经下载了 libtollpc-devel将我的ldlibs在makefile中更改为-ltirpc。
现在我的exes被创建了。
Finally the error got solved.
I have downloaded libtirpc-devel from cygwin, and changed my LDLIBS in makefile to -ltirpc.
Now my exes got created.