Re: warning: type `string' has a user-defined constructor
Re: warning: type `string' has a user-defined constructor
- Subject: Re: warning: type `string' has a user-defined constructor
- From: "Clark Cox" <email@hidden>
- Date: Wed, 12 Sep 2007 14:37:05 -0700
On 9/12/07, email@hidden <email@hidden> wrote:
> Hi
>
> I am using objective-c++ (or .mm files)
>
> In my header file I have defined a std::string variable.
>
> @interface MyStuff : NSObject
> {
> std::string myString;
> }
>
> When compiling I get the warning: type `string' has a user-defined
> constructor.
>
> Then in my init method I get a BAD_ACCESS_EXE exception thrown when
> assigning a value to myString
>
> - (MyStuff *) init {
> myString.assign("123");
> }
>
> I can kind of guess that myString constructor has not been called?
> What is the correct way of setting this up.
Make sure that you've passed the -fobjc-call-cxx-cdtors flag to the compiler.
--
Clark S. Cox III
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden