Unable to find standard libraries when compiling Objective-C using GNUstep on Windows

Jason Roberts picture Jason Roberts · Feb 25, 2009 · Viewed 25.7k times · Source

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?

Answer

epatel picture epatel · Feb 25, 2009

Have a look here. It seems like one needs a bunch of parameters to the compile command.