Search code examples
gccmakefilecygwinrpc

Linker path not found


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.


Solution

  • 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.