C++ constructor help (repost)

3 messages Options
Embed this post
Permalink
Jimmy Johnson

C++ constructor help (repost)

Reply Threaded More More options
Print post
Permalink
How do I call a constructor. I tried to follow an example I got
from EiffelRoom:

c_create: POINTER is
-- Call the cpp constructor
external
"C++ inline use %"iNXTIterator.h%""
alias
"[
return new iNXTIterator;
]"
end

but I get this error during c compilation:

c:\e_projects\eifgens\mindstorms_tester\w_code\c1\nx586.cpp(34) : error C2061:
syntax error : identifier 'iNXTIterator'




rfo

RE: C++ constructor help (repost)

Reply Threaded More More options
Print post
Permalink
Hi Jimmy!

You might need to put your return args into an arg list.  In other
words, use parentheses.

alias
"[
return (new iNXTIterator);
]"
end



     R

==================================================
Roger F. Osmond


> -------- Original Message --------
> Subject: [eiffel_software] C++ constructor help (repost)
> From: "Jimmy J. Johnson" <[hidden email]>
> Date: Sat, June 27, 2009 12:22 pm
> To: [hidden email]
> How do I call a constructor. I tried to follow an example I got
> from EiffelRoom:
> c_create: POINTER is
> -- Call the cpp constructor
> external
> "C++ inline use %"iNXTIterator.h%""
> alias
> "[
> return new iNXTIterator;
> ]"
> end
> but I get this error during c compilation:
> c:\e_projects\eifgens\mindstorms_tester\w_code\c1\nx586.cpp(34) : error C2061:
> syntax error : identifier 'iNXTIterator'

Jimmy Johnson

Re: C++ constructor help (repost)

Reply Threaded More More options
Print post
Permalink
No it was a namespace issue.  
        "return new nFANTOM100::tStatus"
seems to have fixed it.  It compiles, at least.

Now to figuring out when to use stars, ampersands, and dollar signs and the mysterious "char**" in the Eiffel and C++ code.  ...unless someone wants to give me a quick c++ refresher ;)

jjj


--- In [hidden email], <rfo@...> wrote:

>
> Hi Jimmy!
>
> You might need to put your return args into an arg list.  In other
> words, use parentheses.
>
> alias
> "[
> return (new iNXTIterator);
> ]"
> end
>
>
>
>      R
>
> ==================================================
> Roger F. Osmond
>
>
> > -------- Original Message --------
> > Subject: [eiffel_software] C++ constructor help (repost)
> > From: "Jimmy J. Johnson" <boxer41a@...>
> > Date: Sat, June 27, 2009 12:22 pm
> > To: [hidden email]
> > How do I call a constructor. I tried to follow an example I got
> > from EiffelRoom:
> > c_create: POINTER is
> > -- Call the cpp constructor
> > external
> > "C++ inline use %"iNXTIterator.h%""
> > alias
> > "[
> > return new iNXTIterator;
> > ]"
> > end
> > but I get this error during c compilation:
> > c:\e_projects\eifgens\mindstorms_tester\w_code\c1\nx586.cpp(34) : error C2061:
> > syntax error : identifier 'iNXTIterator'
>