I'm just starting to do objective-c with gcc (so far I have only 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 as soon as I try to compile the material, I get the following:
main.m: In function 'main': main.m:8: warning: 'Integer' may not respond to '+new' main.m:8: warning: (Messages without a matching method signature main.m:8: warning: will be assumed to return 'id' and accept main.m:8: warning: '...' as arguments.) main.m:8: warning: 'Integer' may not respond to '+new'
It seems to me that the inclusion of Object.h did not quite work. I searched it for Object.h and got the following:
find /usr/include/ -name Object.h /usr/include
GCC's output also suggests that the compiler is really looking in this way.
#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 by 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 to '+new' main.m:8: warning: (Messages without a matching method signature main.m:8: warning: will be assumed to return 'id' and accept main.m:8: warning: '...' as arguments.) main.m:8: warning: 'Integer' may not respond to '+new'`\
What am I missing?
source share