Error With Foundation.h

Posted by Nathan Campos on Stack Overflow See other posts from Stack Overflow or by Nathan Campos
Published on 2009-10-18T00:02:13Z Indexed on 2010/05/21 10:00 UTC
Read the original article Hit count: 447

Filed under:
|
|

Hello,

I learning Objective-C in Linux(Ubuntu), but when i tryed to compile my application that needs the Foundation headers i got an error saying that the file cannot be found, but i have installed the GNUstep development package(gnustep-devel). Here is my code:

// Fraction.h
#import <Foundation/NSObject.h>

@interface Fraction: NSObject {
    int numerator;
    int denominator;
}

- (void) print;
- (void) setNumerator: (int) n;
- (void) setDenominator: (int) d;
- (void) numerator;
- (void) denominator;
@end

And here is the console log:

ubuntu@eeepc:~$ gcc main.m -o frac -lobjc
In file included from main.m:3:
Fraction.h:2:26: error: objc/NSObject.h: No such file or directory
In file included from main.m:3:
Fraction.h:4: error: cannot find interface declaration for ‘NSObject’, superclass of ‘Fraction’
ubuntu@eeepc:~$

What i need to do?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about foundation