Gcc Error Foundation/nsobject.h No Such File Or Directory
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more foundation/foundation.h no such file or directory ubuntu about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges
Undefined Reference To `objc_get_class'
Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each
Undefined Reference To Symbol 'objc_msg_lookup'
other. Join them; it only takes a minute: Sign up Cant find Foundation/NSObject.h in Linux while build Obj-c Program up vote 4 down vote favorite 2 I was just starting to study obj-c on Ubuntu Linux today, the
Foundation.h Not Found
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 gnustep ubuntu all the dev packages related to GNUstep but still no luck. Hope I state my question clear enough. Sorry for my English. objective-c linux gnustep share|improve this question edited Apr 15 '11 at 5:42 asked Apr 15 '11 at 4:40 hjbolide 128111 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote Try with gnustep-config gcc `gnustep-config --objc-flags` \ `gnustep-config --objc-libs` Fraction.m -o Fraction share|improve this answer answered May 6 '11 at 20:03 mathk 3,66342053 thanks, I'll try that when I get home, and return to this post –hjbolide May 7 '11 at 1:45 add a comment| up vote 0 down vote 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. share|improve this answer answered Apr 15 '11 at 4:45 Sherm Pendley 11.9k13554 thanks for your answer, but I can't even find the Headers in my computer, which means I have no NSObject.h file in my system. any suggestion? –hjbolide Apr 15 '11 at 5:41 1 According to
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Unable to find standard libraries when compiling Objective-C http://stackoverflow.com/questions/5672460/cant-find-foundation-nsobject-h-in-linux-while-build-obj-c-program using GNUstep on Windows up vote 10 down vote favorite 2 I just installed GNUstep on my Windows XP machine and I'm attempting to compile the following Objective-C Hello World program from the command line: #import
06:57 AMHi. I'd like to set up an environment for learning objective C on my laptop. I'm using Hardy on a 32-bit system. I found this page: http://blog.lyxite.com/2008/01/compile-objective-c-programs-using-gcc.html But https://ubuntuforums.org/archive/index.php/t-890425.html the installation instructions were brief and insufficient. I install these packages via apt-get: https://lists.gnu.org/archive/html/gnustep-dev/2012-05/msg00022.html gnustep gnustep-base-runtime gnustep-base-libgnustep-base-dev libgnustep-base1.14 libgnustep-gui-dev libgnustep-gui0.12 common Compiling his example, I get: hello.m:2:34: error: Foundation/Foundation.h: No such file or directory hello.m:5: error: cannot find interface declaration for ‘NSObject’, superclass of ‘HelloWorld’ hello.m: In function ‘-[HelloWorld hello]’: hello.m:10: error: cannot find interface declaration for ‘NXConstantString’ hello.m: In function ‘main’: hello.m:15: warning: ‘HelloWorld’ may not respond to ‘+alloc’ no such hello.m:15: warning: (Messages without a matching method signature hello.m:15: warning: will be assumed to return ‘id’ and accept hello.m:15: warning: ‘...’ as arguments.) hello.m:15: warning: no ‘-init’ method found hello.m:17: warning: ‘HelloWorld’ may not respond to ‘-release’ I figure the first line means that I'm missing an essential set of header files. I'm also guessing that this should be fixed after I apt-get the right package. Which further package or no such file packages do I need? Thanks ilrudieAugust 15th, 2008, 01:08 PMMost likely you are just not searching in the right place on your pc for the headers. Put the full path to the header in your include statement or better yet use the -I option on gcc to include a path to search for header files. If you don't know where the headers are (and I don't know where objective-c headers would be either) use find / -name header_file_name.h -printIf that doesn't work you will then need to find which package include the required header file. Search for it in synaptic. jgfootJanuary 5th, 2009, 02:08 AMI struggled with this for a while myself, but I think I've got it working. To compile PURE Objective-C -- that is, NO GNUSTEP -- you can just do a command like this from the command line (where foo.m is your source code): $ gcc -lobjc foo.m -o foo_run Basically, the same as for compiling any other code with gcc, except you include "-lobjc" to link the Objective-C library. But, there isn't much point in writing Objective-C without GNUStep. To use GNUStep, I had to do the following: 1. Make sure the gnustep-common package is installed. (Of course, you also need build-essentials a
May 2012 13:41:24 -0400 I'm answering my own email.....Onhttp://wwwmain.gnustep.org/resources/downloads.php?site=ftp%3A%2F%2Fftp.gnustep.org%2Fpub%2Fgnustep%2FDo *not* use GNUstep-startupDownload the four individual packages (Make/Base/GUI/Backend) and#1 : compile / install make#2 : compile / install libobjc2#3 : compile / install the three remaining (Base/Gui/Backend)Enjoy!It works ;-)Very happy camper.-- LaurentPS/ Only issue I have now is in my code:Calling [GSMutableSet -enumerateObjectsUsingBlock:] with incorrect signature. Method has address@hidden:4^{?=^vii^?}8, selector has address@hidden:address@hiddenThis happens when the following runs (and that runs fine on MacOS 10.7.x)-(float)varOrdering:(id