包含rpcgen的路径

时间:2016-07-11 18:17:31

标签: c multithreading makefile rpc

非常简单的疑问:我使用ParDo来实现在向量中应用数学函数并将其返回给客户端的RPC服务器。因此,我需要使用rpcgen。但是,由于我使用makefile而不是使用<math.h>make通过gcc编译项目,我对我应该如何做到这一点感到困惑。在g++中简单地包含文件并使用rpc_server.c函数时,我得到:

log(x)

这是我的makefile:

cc -g -DRPC_SVC_FG    -c -o rpc_xdr.o rpc_xdr.c
cc -g -DRPC_SVC_FG     -o rpc_client  rpc_clnt.o rpc_client.o rpc_xdr.o -lnsl 
cc -g -DRPC_SVC_FG    -c -o rpc_svc.o rpc_svc.c
cc -g -DRPC_SVC_FG    -c -o rpc_server.o rpc_server.c
cc -g -DRPC_SVC_FG     -o rpc_server  rpc_svc.o rpc_server.o rpc_xdr.o -lnsl
rpc_server.o: In function `ln_4_svc':
/home/gfrebello/Desktop/Sistemas Distribuídos/RPC/rpc_server.c:27: undefined reference to `log'
collect2: error: ld returned 1 exit status
makefile:42: recipe for target 'rpc_server' failed
make: *** [rpc_server] Error 1

我也想在我的最终应用程序中使用多线程(pthreads),我甚至不知道是否可以使用此设置。我至少在添加库路径时遇到同样的问题。

提前致谢。

0 个答案:

没有答案
相关问题