Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_Che", referenced from:
objc-class-ref in 1类-AWRDrA.o
"_OBJC_IVAR_$_Che.lunzi", referenced from:
_main in 1类-AWRDrA.o
"_OBJC_IVAR_$_Che.shisu", referenced from:
_main in 1类-AWRDrA.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation
代码如下:
#import <Foundation/Foundation.h>
@interface Che : NSObject
{
@public
int lunzi;
int shisu;
}
@end
int main()
{
Che *p = [Che new];
p->lunzi = 4;
p->shisu = 130;