hjbolide
hjbolide

Reputation: 391

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

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.

Upvotes: 4

Views: 5663

Answers (4)

In my case, I installed gnustep-base to fix this error:

yum install gnustep-base

Upvotes: 0

In my case, compiling SOPE on CentOS 7, installed

yum install gnustep-base-devel

This solved the problem.

Upvotes: 0

mathk
mathk

Reputation: 8143

Try with gnustep-config

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

Upvotes: 1

Sherm Pendley
Sherm Pendley

Reputation: 13622

GNUStep uses a fairly involved set of gmake macros - I wouldn't expect a simple command-line invocation of gcc to work very well, although to be honest I haven't tried that way myself. I found Nicolo Pera's tutorial and the project's own reference page to be quite useful when learning how to write make files for use with GNUStep.

Upvotes: 0

Related Questions