0

I am working on sunrpc library developed by Sun Microsystems on windows.

I have downloaded GnuWin32 sunrpc4.0 on windows 10.

I am running rpcgen -a -C -Y "C:/MinGW/bin" add.x command and I am able to get .c , .h and Makefile files.

Now I am compiling using make -f Makefile. I am getting following error "fatal error: rpc/rpc.h: No such file or directory"

I have installed "rpcsvc-proto" package from cygwin tool. My rpc.h file location is C:/cygwin64/usr/include/rpc/rpc.h. I have included this path into environmental variables. Still I am getting this file not found error.

I have made following changes to my Makefile

CC = gcc
CFLAGS += -g -DRPC_SVC_FG
LDLIBS += -lnsl 
RPCGENFLAGS =

Can somebody help me on this?

Thanks in advance.

shravani
  • 11
  • 4
  • do NOT mix Cygwin libraries and Mingw build. Use Cygwin library only for Cygwin build – matzeri Jun 16 '22 at 17:30
  • @matzeri, I tried to run my code from cygwin shell. Now error for #include is solved. Thanks to you. But now I am getting different error for LDLIBS: "/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" How to deal with this? any idea? In my Makefile LDLIBS = -lnsl is written. – shravani Jun 17 '22 at 12:26

1 Answers1

0

There is a portable implementation of XDR which comes with rpc/rpc.h at http://people.redhat.com/~rjones/portablexdr/

I was able to build it with MinGW-w64 with some tweaks, see: https://github.com/brechtsanders/winlibs_recipes/blob/main/recipes/portablexdr.winlib

Brecht Sanders
  • 6,215
  • 1
  • 16
  • 40