Subject: Re: [dtn-users] Problem compiling the cvs code on cygwin.
From: "Zahir Koradia" <[email-masked]>
To: [email-masked]
Date: Tue, 31 Oct 2006 17:55:07 +0530
List-Id: discussion/answers list for users of the dtn reference implementation <dtn-users.mailman.dtnrg.org>

Hi Mike,
Apart from the change you suggested following are the changes I made to get
moving ahead.

In file BundleEvent.h
bundlesendrequest:action_ int to int32_t
bundlereceivedevent:source_ int to u_int32_t
bundledeliveryevent:source_ int to u_int32_t

In file Forwardinginfo.h
Forwardinginfo:action_ int to int32_t
Forwardinginfo:state_ int to int32_t

In file Link.h
Link:state_ int to int32_t

In file Registration.h
Registration:failure_action_ int to int32_t

In file RouteEntry.h
RouteEntry:action_ int to int32_t

In RouteEntry.cc
at line 70,  p.addopt(new oasys::EnumOpt("action", fwdopts, &action_));
since action_ had been changed to int32_t from int, the required parameter
was int and it was getting int32_t. So I replaced the line with

int temp_action;
p.addopt(new oasys::EnumOpt("action", fwdopts, &temp_action));
action_=(int32_t)temp_action;

After these changes I had a linker error "undefined reference to
xdr_free(int (*)(), char *)". xdr_free is called in two places: one in
XDRUtils.h and the other in dtn_api.c. The call in dtn_api.c is present in
the previous code that I used and it compiles well. The new call in
XDRUtils.h is not present in the code I used earlier. This code compiles
well on linux platforms but has the linker error with cygwin. One thing I
noticed was that the call in dtn_api.c is from C code while that in
XDRUtils.h is in C++ code. This is probably an issue of name mangling but am
not sure how to get rid of it. Any suggestion in this regard would be
useful.

Also please let me know if the type conversion that I have done are safe to
use.

Thanks,
Zahir Koradia

On 10/30/06, Michael Demmer <[email-masked]> wrote:
>
> Try changing the reason_ field type in the ContactEvent class to be a
> u_int32_t instead of an int. If that works, let me know and I'll
> check in the change.
>
> -m
>
> On Oct 30, 2006, at 3:09 AM, Zahir Koradia wrote:
>
> > Hello All,
> > I was having problems with creation of a link at run time in the
> > old code(about 2 months old) I was using (the state of the link got
> > stuck at "OPENING") and wanted to try out my changes in the new cvs
> > code. But the new code seems to be having some problems installing
> > on Cygwin. The error that I am getting is in the file
> > BundleEvent.cc line 196. The compiler could not choose one of the
> > overloaded process() functions unambiguously for the call. At the
> > call the parameters are (const char[7], and int*) and the two
> > candidates of process functions among which the compiler had
> > confusion have parameters (const char*, int32_t*) and (const char*,
> > long unsigned int*) I am not aware of that part of the code. Can
> > some please help me out as to which function should be used and
> > what changes can I samely make to go ahead in compilation?
> >
> > Thanks,
> > Zahir Koradia
>
> _______________________________________________
> dtn-users mailing list
> [email-masked]
> http://mailman.dtnrg.org/mailman/listinfo/dtn-users
>