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: Steve Checkoway <email@hidden>
- Date: Thu, 1 Jul 2004 18:14:33 -0700
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.
- Steve
_______________________________________________
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.