Class passed as reference to lib function.
Class passed as reference to lib function.
- Subject: Class passed as reference to lib function.
- From: "Andy Bearsley" <email@hidden>
- Date: Tue, 19 Apr 2005 18:29:37 +1200
- Importance: Normal
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:
This email sent to email@hidden