I use xcode 4, I already compiled Cocoa applictions without problems, but if I choose to compile a simple command line tool like this one:
#import <Foundation/Foundation.h>
#import <stdio.h>
int main (int argc, const char * argv[])
{
printf("Hello world");
return 0;
}
I get a lot of parse and sematic issues:
If this isn't enough I could take the screen of the whole window. So what could be the reason of these errors?
You named your main file as main.cpp
. That's a C++ file. You then handed it Objective-C. Your main file should be main.m
.