Skip to content

Issues compiling on RHEL 8 #2

@max3925vats

Description

@max3925vats

Hello, thanks a lot for maintaining this library.
I'm encountering some issues when trying to compile this on RHEL 8.
Using the default Makefile, upon issuing make, I get the following output:

m4 conf/linux.m4 libxdrf.m4 > libxdrf.c
gcc -O -Dlinux  -c libxdrf.c
In file included from libxdrf.c:156:
/usr/include/tirpc/rpc/rpc.h:38:10: fatal error: rpc/types.h: No such file or directory
#include <rpc/types.h>  /* some typedefs */
         ^~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:83: libxdrf.o] Error 1

Turns out, rpc header files have moved on RHEL 8. They are now made available through the tirpc-devel package.
To account for this, I modified the Makefile; added -I/usr/include/tirpc to CFLAGS and -ltirpc to LIBS.
Now, when issuing make, I get the following output:

m4 conf/linux.m4 libxdrf.m4 > libxdrf.c
gcc -O -Dlinux -I/usr/include/tirpc -c libxdrf.c
In file included from libxdrf.c:160:
xdrf.h:13:5: error: conflicting types for ‘xdrstdio_create’
 int xdrstdio_create(XDR *xdrs, const char *filename, const char *type);
     ^~~~~~~~~~~~~~~
In file included from /usr/include/tirpc/rpc/rpc.h:43,
                 from libxdrf.c:156:
/usr/include/tirpc/rpc/xdr.h:358:15: note: previous declaration of ‘xdrstdio_create’ was here
 extern void   xdrstdio_create(XDR *, FILE *, enum xdr_op);
               ^~~~~~~~~~~~~~~
libxdrf.c: In function ‘xdropen’:
libxdrf.c:505:46: warning: passing argument 2 of ‘xdrstdio_create’ from incompatible pointer type [-Wincompatible-pointer-types]
     xdrstdio_create(xdridptr[xdrid], xdrfiles[xdrid], lmode);
                                      ~~~~~~~~^~~~~~~
In file included from libxdrf.c:160:
xdrf.h:13:44: note: expected ‘const char *’ but argument is of type ‘FILE *’ {aka ‘struct _IO_FILE *’}
 int xdrstdio_create(XDR *xdrs, const char *filename, const char *type);
                                ~~~~~~~~~~~~^~~~~~~~
libxdrf.c:505:55: error: incompatible type for argument 3 of ‘xdrstdio_create’
     xdrstdio_create(xdridptr[xdrid], xdrfiles[xdrid], lmode);
                                                       ^~~~~
In file included from libxdrf.c:160:
xdrf.h:13:66: note: expected ‘const char *’ but argument is of type ‘enum xdr_op’
 int xdrstdio_create(XDR *xdrs, const char *filename, const char *type);
                                                      ~~~~~~~~~~~~^~~~
make: *** [Makefile:83: libxdrf.o] Error 1

What other changes do I need to make to get this working? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions