Reputation: 961
I see the following strange error if I include any POCO header file in a .mm file or a .h file. If I include the headers in .cpp file then the project successfully compiles. Any help or sample code to make POCO running with objective C project will be appreciable.
Here is the code:
//File: test.mm
#import "test.h"
#include "Poco/JSON/Object.h"
@implementation test
-(void)test{
Poco::JSON::Object obj;
}
@end
Here is the screenshot of the error
Detailed error:
In file included from /Users/a/Desktop/test/theta/theta/test.mm:10:
In file included from /Users/a/Desktop/poco-1.6.0- all/JSON/include/Poco/JSON/Object.h:24:
In file included from /Users/a/Desktop/poco-1.6.0-all/JSON/include/Poco/JSON/Array.h:25:
In file included from /Users/a/Desktop/poco-1.6.0-all/Foundation/include/Poco/Dynamic/Var.h:26:
In file included from /Users/a/Desktop/poco-1.6.0-all/Foundation/include/Poco/Dynamic/VarHolder.h:24:
In file included from /Users/a/Desktop/poco-1.6.0-all/Foundation/include/Poco/NumberFormatter.h:24:
/Users/a/Desktop/poco-1.6.0-all/Foundation/include/Poco/NumericString.h:261:8: error: expected member name or ';' after declaration specifiers
void check(char* ptr)
~~~~ ^
Upvotes: 3
Views: 861
Reputation: 961
ok, the reason for the error is that POCO header is conflicting with one of the header files in the OSX SDK. Adding the following line before inclusion of any headers fixed the compilation problem.
#undef check
Upvotes: 3