You can use C and C++ files in Xcode, but you must must create it correct for the Xcode-compiler. With "File->New->File" and select the correct type in the wizard.
It is easier to separate the Cocoa classes from pure C/C++. We often use a Coca-Wrapper class which converting the data to pure C data and than calling some C++.
- (void) write: (NSString*) text
{
char *text = [text cStringUsingEncoding:NSUTF8StringEncoding];
LogMessage(text);
}