Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 458
Jason Roberts Avatar asked Feb 25 '09 19:02

Jason Roberts


2 Answers

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

like image 88
epatel Avatar answered Oct 07 '22 23:10

epatel


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
like image 40
csk Avatar answered Oct 07 '22 23:10

csk