Installing the Object Compiler c

I wanted to install the c object compiler for ubuntu.
this site was used to install GNUstep on ubuntu. http://www.techotopia.com/index.php/Installing_and_Using_GNUstep_and_Objective-C_on_Linux then the commands were written in the following order in the terminal


sudo apt-get install gnustep sudo apt-get install gnustep-devel 

then I wrote my sample code and saved it as hello.m


 #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSLog (@"hello world"); [pool drain]; return 0; } 

then I dialed the terminal


 . /usr/share/GNUstep/Makefiles/GNUstep. 

 gcc `gnustep-config --objc-flags` -lgnustep-base hello.m -o hello 

then an error message appeared that


 gcc: gnustep-config --objc-flags: No such file or directory hello.m:1:23: fatal error: Foundation.h: No such file or directory compilation terminated. 

then i wrote


 sudo apt-get install gobjc 

then the terminal showed


 Reading package lists... Done Building dependency tree Reading state information... Done gobjc is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 205 not upgraded. 

then I compiled again, but it again showed the same error.


 hp@ubuntu :~$ gcc 'gnustep-config --objc-flags' -lgnustep-base hello.m -o hello gcc: gnustep-config --objc-flags: No such file or directory hello.m:1:23: fatal error: Foundation.h: No such file or directory compilation terminated. 

so you need help ..

+4
source share
1 answer

Try to run:

 gnustep-config --objc-flags 

on its own to check if it returns an error or the corresponding gcc flags, etc.

Also, try finding a location for the include directory and adding it explicitly with the -Idir parameter in gcc

+3
source

All Articles