This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with sunrpc

On Tue, 2006-06-13 at 05:07 +0530, Zahir Koradia wrote:
> Hi,
> This message might be specifically for Sam Robb but am sending to the
> whole list as others may be able to help. I installed the binaries and
> downloaded the source of sunrpc while installing cygwin. I intended to
> use the function clnttcp_create present in clnt.h header. The anamoly
> I see is that in the header file the signature has no parameters and
> in the source code the function definition has parameters.

This should be OK, believe it or not - the sunrpc headers use older
(K&R) style function prototypes.  Some information if you're interested:

> and the source code (clnt_tcp.c) definition had the line
> This code does not compile.

It shouldn't.  This is part of the sunrpc library - you shouldn't have
to rebuild it.

Instead, you should be able to use the clnttcp_create() function from
the library by including <rpc/rpc.h> in your source file, and linking to
the rpc libraries by using -lrpc.  For example:

  Compile: gcc -o rpc-example.exe rpc-example.c -lrpc

#include <rpc/rpc.h>

int main(int argc, char** argv) {
    clnttcp_create(NULL, 0, 0, NULL, 0, 0);
    return 0;

Note that the above doesn't actually do anything useful - it just shows
you how to include the rpc headers, and compile and link to the rpc


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]