ARWIN
ARWIN

Reputation: 126

Foundation/NSObject.h: No such file or directory what the reason on windows

When I compiled an Objective-C code on Windows, I got this error.

$ gcc -o abc main.m

In file included from MyClass.m:2,
                 from main.m:2:

myclass.h:1:32: Foundation/NSObject.h: No such file or directory

In file included from MyClass.m:2,
                 from main.m:2:
myclass.h:4: error: syntax error before '(' token
myclass.h:6: error: cannot find interface declaration for `NSObject', superclass of `myclass'

Why is that? How can I fix this?

Upvotes: 0

Views: 4128

Answers (2)

ARWIN
ARWIN

Reputation: 126

Thanks to initiate my help dear frnds i hv just got the answer after posting this question. so the command to compile in window environment is this..

gcc `gnustep-config --objc-flags` -o myf main.m -L /GNUstep/System/Library/Libraries -lobjc -lgnustep-base 

thanks for all.

Upvotes: 2

Chuck
Chuck

Reputation: 237040

You say you're on Windows. Do you in fact have an environment (such as GNUstep or Cocotron) that would give you the Foundation framework installed and set up correctly? Because I would guess not, and not having Foundation would indeed lead to errors about not having Foundation.

Upvotes: 0

Related Questions