Re: Mixing Objective-C and C++ in Xcode
Re: Mixing Objective-C and C++ in Xcode
- Subject: Re: Mixing Objective-C and C++ in Xcode
- From: Albion Baucom <email@hidden>
- Date: Fri, 2 Jul 2004 13:20:47 -0700 (PDT)
Bingo Steve! That is the ticket. Your explination made perfect sense.
Of course I need to figure out how declare class variables that are
classes from my C++ code without declaring them in the header interface
decleration.
Also I have to figure out why I get EXC_BAD_ACCESS faults. ;)
Thanks again Steve!
Albion
On Thu, 1 Jul 2004, Steve Checkoway wrote:
>
On Jul 1, 2004, at 5:56 PM, Albion Baucom wrote:
>
> UI front end. So at some point I have a Obj-C header including a C++
>
> header so I can access methods and data in that C++ code via the Obj-C
>
>
You should likely be including the c++ header file from within the
>
source file, not the Obj-C header. Also, any source file that is
>
including the c++ header file needs to be compiled as c++ (or obj-c++).
>
>
Let's say you have:
>
foo.h
>
foo.cpp
>
bar.h
>
bar.m
>
>
and you want to use a class declared in foo in your bar.m. You should
>
rename bar.m to bar.mm and bar.mm should #include "foo.h". bar.h Should
>
not include foo.h, especially if it is going to be included by another
>
objective-c source file. Otherwise that one would need to be .mm as
>
well.
>
>
I hope that made any sense.
Albion E. Baucom
http://rna.ucsc.edu/albion
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.