I just installed GNUstep on my Windows XP machine and I'm attempting to compile the following Objective-C Hello World program from the command line:
#import <Foundation/Foundation.h>
int main(int argc, const char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog(@"Hello world\n");
[pool drain];
return 0;
}
When I try to compile the program from the command line like so
gcc hello.m -o hello
I end up getting the following error
hello.m:1:34: Foundation/Foundation.h: No such file or directory
Is there something I need to do order to inform the compiler of where the standard Objective-C libraries are located?
Have a look here. It seems like one needs a bunch of parameters to the compile command.
try to run this command line in your command. it worked for me.
gcc -I"c:/GNUstep/GNUstep/System/Library/Headers" -L "c:/GNUstep/GNUstep/System/Library/Libraries" -o hello helloWorld.m -lobjc -lgnustep-base -fconstant-string-class=NSConstantString
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With