Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to build RPC project with libtirpc

Tags:

c

linux

rpc

glibc

I had working project based on RPC. Unfortunately I was forced to update glibc to 2.27-3. This update cleaned all rpc headers from /usr/include/rpc. I found, that they were deprecated and now are available in libtirpc package. The problem is, that i don't know how to use them. I tried to change my includes from

#include <rpc/rpc.h>

to

#include <tirpc/rpc/rpc.h>

but some of rpc headers include others from /rpc, so they also couldn't find them. Then I copied the content of /usr/include/tirpc to /usr/include/rpc. It moved building further, but im still unable to build project because of:

/usr/bin/ld: status_svc.o: undefined reference to symbol 'svcerr_noproc@@TIRPC_0.3.0' /usr/lib/libtirpc.so.3: error adding symbols: DSO missing from command line

collect2: error: ld returned 1 exit status

Here is part of my makefile:

# Compiler flags 

CFLAGS += -g -pthread
LDLIBS += -lnsl
RPCGENFLAGS = 
like image 749
JanW Avatar asked Oct 17 '25 04:10

JanW


1 Answers

You could use -I/usr/include/tirpc as a compiler flag (in CFLAGS) to avoid the need for patching the files. This is apparently the way the header files are intended to be used on your distribution.

The linker issue you should be able to avoid by linking against -ltirpc.

like image 138
Florian Weimer Avatar answered Oct 18 '25 19:10

Florian Weimer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!