azamsharp
azamsharp

Reputation: 20068

Objective-C errors with Xcode

I added a simple class to my Xcode command line tool project. The class is shown below:

#import <Foundation/Foundation.h>

@interface Foo : NSObject {
}
@end

and

#import "Foo.h"

@implementation Foo
@end

As soon as I reference Foo.h using #import "Foo.h" in my main file I get all type of errors. I have Foundation.frameowork added as my frameworks.

/Developer/SDKs/MacOSX10.6.sdk/System/
    Library/Frameworks/Foundation.framework/Headers/
NSObjCRuntime.h:189:1: error: expected identifier or '(' [3]

/Developer/SDKs/MacOSX10.6.sdk/System/
    Library/Frameworks/Foundation.framework/Headers/
NSObjCRuntime.h:197:50: error: unknown type name 'Protocol' [3]

Upvotes: 2

Views: 3018

Answers (1)

NSGod
NSGod

Reputation: 22948

I'm guessing that you probably need to rename main.c to main.m? Otherwise, can you post the content of your main file?

Upvotes: 8

Related Questions