Problem with Objective-C++ Header Files
Stephen Furlani <[email protected]>
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I have attempted searching the archives, but the search function keeps
truncating "objective-c++" to "objective-c " so if there's a good location
to look for this information, I can't find it.
I have an extensive library of C++ code that I want to be able to
incorporate into my Objective-C project. Following the tutorials provided
by Apple and others, I've renamed my object file to .mm to utilize
Objective-C++.
If I include the header files from my C++ library, I get a swath of errors,
namely surrounding the use of 'id' in the subsequent included C++ header
files. I also get some more serious errors in the incompatibility between
X.h (from XFree86) and objc.h over the use of 'BOOL' and 'cursors'.
Renaming the object file back to .cpp, the project compiles without error,
so I know it's because of the inclusion of the Objective-C keywords.
How can I tell XCode to include those headers strictly as C++ headers and
not Objective-C headers? I thought using #include instead of #import would
be clear enough.
Is there a better way of importing C++ headers and libraries into a Obj-C
project?
My code is simply thus:
// main.mm
#include "userLibrary.h"
int main (const int argc, char** argv) {
return 0;
}
Which generates a multitude of errors (1700+).
Compiled as:
// main.cpp
#include "userLibrary.h"
int main (const int argc, char** argv) {
return 0;
}
everything compiles fine.
Thank you,
--
-Stephen Furlani
Biomedical Software Engineer
e: [email protected]
c: 240-491-7288