error: undefined reference to `xdrmem_create'

Hi…

what library do I need to compile against to generate code that utilizes
the <rpc/rpc.h> calls?

Regards…

Miguel

qcc -V gcc_ntox86 example1.c -o rpc1
/tmp/AAA314855_cc.o: In function `main’:

/tmp/AAA314855_cc.o(.text+0x34): undefined reference to xdrmem_create' /tmp/AAA314855_cc.o(.text+0x78): undefined reference to xdr_int’
/tmp/AAA314855_cc.o(.text+0xbc): undefined reference to `xdr_wrapstring’
cc: /usr/bin/ntox86-ld error 1

===================================

#include <rpc/xdr.h>

int main(int argc, char *argv[])
{
char buf[1024];
XDR x;
int n=5;
char *s=“Hello, world.”;

xdrmem_create(&x,buf,1024,XDR_ENCODE);
printf("%d\n",xdr_getpos(&x));
xdr_int(&x,&n);
printf("%d\n",xdr_getpos(&x));
xdr_wrapstring(&x,&s);
printf("%d\n",xdr_getpos(&x));
return 0;
}

\

my opinions are mine, only mine, solely mine, and they are not related
in any possible way to the institution(s) in which I study and work.

Miguel Simon
Research Engineer
School of Aerospace and Mechanical Engineering
University of Oklahoma
http://www.amerobotics.ou.edu/
http://www.saic.com

Hi…

Never mind… I found it. librpc ofcourse. Sorry.

In any case, has any body have had any experience/coments to with xdr
and rpc? Any thing to share? Thanks.

Regards…

Miguel.


Miguel Simon wrote:

Hi…

what library do I need to compile against to generate code that utilizes
the <rpc/rpc.h> calls?

Regards…

Miguel

qcc -V gcc_ntox86 example1.c -o rpc1
/tmp/AAA314855_cc.o: In function main': /tmp/AAA314855_cc.o(.text+0x34): undefined reference to xdrmem_create’
/tmp/AAA314855_cc.o(.text+0x78): undefined reference to xdr_int' /tmp/AAA314855_cc.o(.text+0xbc): undefined reference to xdr_wrapstring’
cc: /usr/bin/ntox86-ld error 1

===================================

#include <rpc/xdr.h

int main(int argc, char *argv[])
{
char buf[1024];
XDR x;
int n=5;
char *s=“Hello, world.”;

xdrmem_create(&x,buf,1024,XDR_ENCODE);
printf("%d\n",xdr_getpos(&x));
xdr_int(&x,&n);
printf("%d\n",xdr_getpos(&x));
xdr_wrapstring(&x,&s);
printf("%d\n",xdr_getpos(&x));
return 0;
}

\

my opinions are mine, only mine, solely mine, and they are not related
in any possible way to the institution(s) in which I study and work.

Miguel Simon
Research Engineer
School of Aerospace and Mechanical Engineering
University of Oklahoma
http://www.amerobotics.ou.edu/
http://www.saic.com

Hi…

To follow up on myself, a search in the news group in google.com (which
date as far back as the prehistoric times, 1981) yielded some useful
answers.

however, this is interesting (for the benefit of some):

if you use the rcp package with its xdr support( see bellow), and you
write to/from a remote java program, the information in java is native.
Nice. :slight_smile: Notice that this does not imply that you have an RPC section
going, just simple communications. Obvious for some, but a revelation
to others. :slight_smile:

A main use of this could be that, if you write an interface with your
qnx machine from a windows box using your favorite communications
protocol, and then call this java program from Matlab/Simulink, and use
Simulink eRTW output program deployed in your RTOS embedded cpu flying a
mile up in the air, well… the possibilities are endless… If it
makes any sense, bon appetite! :slight_smile: (…but you better have a fast
machine on the ground; the Matlab-Java combination is sloooowww
relatively speaking!)

Regards…

miguel.


Miguel Simon wrote:

Hi…

Never mind… I found it. librpc ofcourse. Sorry.

In any case, has any body have had any experience/coments to with xdr
and rpc? Any thing to share? Thanks.

Regards…

Miguel.


Miguel Simon wrote:

Hi…

what library do I need to compile against to generate code that
utilizes the <rpc/rpc.h> calls?

Regards…

Miguel

qcc -V gcc_ntox86 example1.c -o rpc1
/tmp/AAA314855_cc.o: In function main': /tmp/AAA314855_cc.o(.text+0x34): undefined reference to xdrmem_create’
/tmp/AAA314855_cc.o(.text+0x78): undefined reference to xdr_int' /tmp/AAA314855_cc.o(.text+0xbc): undefined reference to xdr_wrapstring’
cc: /usr/bin/ntox86-ld error 1

===================================

#include <rpc/xdr.h

int main(int argc, char *argv[])
{
char buf[1024];
XDR x;
int n=5;
char *s=“Hello, world.”;

xdrmem_create(&x,buf,1024,XDR_ENCODE);
printf("%d\n",xdr_getpos(&x));
xdr_int(&x,&n);
printf("%d\n",xdr_getpos(&x));
xdr_wrapstring(&x,&s);
printf("%d\n",xdr_getpos(&x));
return 0;
}

\

\

my opinions are mine, only mine, solely mine, and they are not related
in any possible way to the institution(s) in which I study and work.

Miguel Simon
Research Engineer
School of Aerospace and Mechanical Engineering
University of Oklahoma
http://www.amerobotics.ou.edu/
http://www.saic.com