RE: Class passed as reference to lib function.
RE: Class passed as reference to lib function.
- Subject: RE: Class passed as reference to lib function.
- From: "Andy Bearsley" <email@hidden>
- Date: Wed, 20 Apr 2005 11:57:54 +1200
- Importance: Normal
Well... I rolled-back the project files (not source) to prior to the crash,
and the problem has gone away. So I guess I had corrupted project files.
Funky.
> -----Original Message-----
> From: xcode-users-bounces+andy=email@hidden
> [mailto:xcode-users-bounces+andy=email@hidden]On
> Behalf Of Andy Bearsley
> Sent: Tuesday, 19 April 2005 6:30 p.m.
> To: email@hidden
> Subject: Class passed as reference to lib function.
>
>
>
> This used to work... I swear!
> I'm using XCode 1.1, on X 10.3.9
> I have a library project in which is a class containing a static function
> that takes as a parameter a reference to another class:
> static error ca::func(cb & myRef);
>
> In calling from an application project that links to that library:
> cb myOuterRef;
> err = ca::func(myOuterRef);
>
> All pretty standard C++ stuff... and it worked wonderfully...
> until XCode
> exited unexpectedly (although I have to say, I'm starting to expect it...)
> Now, however, the contents of myOuterRef are changing as it
> enters ca::func.
> By this I mean that examining myRef, the contents are different to
> myOuterRef. Given that I'm passing as a reference, this should be
> impossible. If I were on a different development platform I'd say that I
> was compiling the library project with a different calling-convention than
> the application project and my stack was being corrupted on the call.
>
> So... I've cleaned, rebuilt, cleaned, deleted the 'build'
> directories for
> both the lib and app, restarted, rebuilt, redone all the above,
> sacrificed a
> chicken, and prayed to the North Wind. Is there anything else I can do
> (aside from re-creating the two projects, as there are a LOT of files to
> sort thru...).
>
> As an aside... if I change to this:
>
> static error ca::func(cb * myRef);
> ...
> cb myOuterRef;
> err = ca::func(&myOuterRef);
>
> all is well. No stack corruption. myRef happily has the same contents as
> myOuterRef. No, I dont want to change all my class references to
> dereferences... I want a logical solution! And it used to work!
>
>
>
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
esign.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden