This is my first post so please excuse me if I fail to follow any posting conventions. I have been working on an app using a "Cocoa/Objective C" front end in xcode 4.6.2 on OSX 10.7.5, and accessing c++ libraries via Objective c++ adaptor classes. Its been a steep learning curve, but things have been going well. I have now hit a stumbling block that I hope someone on here knows how to fix.
I recently included a new library in my c++ backend, which works perfectly in my 'C++ only' backend experimentation xcode project. But when I try to compile my ObjC/Objc++/C++
version, I get cascading syntax errors in the Objective C++ file, approximately like this:
In Objc++.mm:
#include "objCclass.h" //no problem here
#include "CppBackend.h" //c++ libs included by this file cause the following errors:
@interface objCclass () //!unexpected '@' in program
-(id)classmethods //(class extension to allow access to c++ backend)
@end //!end must appear in an objective c context
//etc,etc....
@synthesize x,y,z; //!Missing context for property implementation declaration
//errors on most lines that work fine when CppBackend.h is not included
Other So posts on similar subjects suggest inane syntax errors causing this problem often, but I'm think this is not the case here. My Cocoa front end works without the backend include, and the backend works perfectly by itself in a c++ only project.
I'd be very greatly for any help. Much appreciation for all the help from people on here for this and other issues.
Marc
UPDATE - I have found that if I comment out the class extensions (and remove any subsequence dependency issues) - it works! Is it possible that there is a problem in the ObjC++ compiler that it doesnt like seeing class extensions?
I have fixed this issue.
The c++ library I was trying to include declared a typedef "interface", which I assume was really upsetting the "@interface" of objective c. I renamed the typedef and all subsequent uses to '_interface', and now it all works!!!
Many thanks to all who offered help on this. I had a intuitive feeling that it wasnt a syntax error, and was some sort of clash between the two libraries.
:):):):):):):):):)