Objective-c – Cant find Foundation/NSObject.h in Linux while build Obj-c Program

gnusteplinuxobjective c

I was just starting to study obj-c on Ubuntu Linux today, the tutorial that I followed is http://www.otierney.net/objective-c.html, when I typed in the code that requires for Foundation/NSObject.h, the error appeared:

Fraction.h:1: fatal error: Foundation/NSObject.h: No such file or directory

and i searched for the solutions, and found a proper one
gcc -o Fraction -I/usr/GNUstep/System/Library/Headers
-L/usr/GNUstep/System/Library/Libraries
Fraction.m
-ldl
-lobjc

I tried this, but I found that I cannot find Headers under the Library directory. (My folder of GNUstep is /usr/share/GNUstep).

Does anyone know how to achieve the Headers?
I installed all the dev packages related to GNUstep but still no luck.

Hope I state my question clear enough. Sorry for my English.

Best Answer

Try with gnustep-config

gcc `gnustep-config --objc-flags` \
    `gnustep-config --objc-libs` Fraction.m -o Fraction
Related Topic