how to include pure C++ header in obj-C in Xcode
how to include pure C++ header in obj-C in Xcode
- Subject: how to include pure C++ header in obj-C in Xcode
- From: Wayne Shao <email@hidden>
- Date: Mon, 9 Aug 2010 23:01:13 -0700
Hi,
I have a C++ util class (note: pure C++, it does not use obj-c objects in
the C++ files).
When I added the C++ classes to Cocoa project, it compiles fine.
But when I add C++ include from the ObjC class, it gives all kinds of
errors.
(Note: this is different from what the guide describes here
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocCPlusPlus.html#//apple_ref/doc/uid/TP30001163-CH10-SW1
)
What is the right way to include C++ headers from objc?
// In objC class
#include "my_util.h" (or #import "my_util.h")
@interface MyObjC : NSObject {
/// typical objc members skipped
MyUtil* util_; // C++ object, compiling error : expected
specifier-qualifier-list before 'MyUtil'
}
@end
--
W. Shao
_______________________________________________
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