objective c - Gcc not including Object.h -


i starting on doing objective-c gcc (so far used xcode).

#include <objc/object.h>   @interface integer : object   {   int integer;   }   - (int) integer;   -(id) integer: (int) _integer;   @end 


#import "integer.h"   @implementation integer   - (int) integer   {       return integer;   }   - (id) integer: (int) _integer   {       integer = _integer;   }   @end 

and once try compile stuff this:

main.m: in function ‘main’:   main.m:8: warning: ‘integer’ may not respond ‘+new’   main.m:8: warning: (messages without matching method signature   main.m:8: warning: assumed return ‘id’ , accept   main.m:8: warning: ‘...’ arguments.)   main.m:8: warning: ‘integer’ may not respond ‘+new’ 

seems me inclusion of object.h did not quite work. searched thee includes object.h , got this:

find /usr/include/ -name object.h    /usr/include//objc/object.h 

also gcc output hints compiler is searching in path.

 #include "..." search starts here:    #include <...> search starts here:    /usr/local/include    /usr/lib/gcc/i686-apple-darwin10/4.2.1/include    /usr/include    /system/library/frameworks (framework directory)    /library/frameworks (framework directory)   end of search list.   gnu objective-c version 4.2.1 (apple inc. build 5664) (i686-apple-darwin10)         compiled gnu c version 4.2.1 (apple inc. build 5664).   ggc heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=131072   compiler executable checksum: 84137cc00ce86c64ee80a91a006f61ae   main.m: in function ‘main’:   main.m:8: warning: ‘integer’ may not respond ‘+new’   main.m:8: warning: (messages without matching method signature   main.m:8: warning: assumed return ‘id’ , accept   main.m:8: warning: ‘...’ arguments.)   main.m:8: warning: ‘integer’ may not respond ‘+new’`\ 

what overlooking?

if gcc couldn't find object.h, give error indicating that. problem apple removed of methods object (or @ least interface it) in objective-c 2.0. instead, should subclass nsobject , include foundation framework.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -