Reputation: 16276
iam beginner in Objective-C, i tried to compile small Hello world program to start,iam using windows vista and the shell console, my code is:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
// insert code here...
NSLog(@"Hello, World!");
[pool drain];
return 0;
}
the shell result show me the following error:
Foundation.h: no such file found
my command for compiling is:
gcc -o hello hello.m
i will appreciate any help, thanx in advance :)
Upvotes: 3
Views: 4756
Reputation: 418
Try writing this to your command line. I had the same problem and it worked for me.
gcc -I"c:/GNUstep/GNUstep/System/Library/Headers" -L "c:/GNUstep/GNUstep/System/Library/Libraries" -o hello hello.m -lobjc -lgnustep-base -fconstant-string-class=NSConstantString
Upvotes: 3
Reputation: 25318
Foundation, as well as NSAutoreleasePool and NSLog are part of cocoa and cocoa-touch, Apples exclusive ObjC Frameworks. While you can use Objective-C, Foundation and all Foundation classes and functions are only available on Mac OS X and iOS.
You have three choices if you want to continue working with ObjC und the classes
Upvotes: 4