未找到链接器路径

发布于 2025-02-09 13:46:03 字数 673 浏览 1 评论 0原文

目前,我正在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

香橙ぽ 2025-02-16 13:46:03

最后,错误解决了。

我已经下载了 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文