tags:

views:

72

answers:

3

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?

A: 

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.

Chuck
A: 

If you're on windows you need to download and setup the development environment first. You clearly have not and are missing dependencies. Try the following site for information on objective-c on windows. http://www.gnustep.org/

ChrisOPeterson
+1  A: 

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.

arv