I have just started learning Objective-C and I am stuck on a very simple issue. I have written a small program and trying to compile it through Mac terminal by using following command:
clang -framework Foundation main.m -o prog
It was working fine until I wrote the following code in main.m
Calculator *calculator = [[Calculator alloc]initWithExpression:expressionArray];
It has started giving me following error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_Calculator", referenced from:
objc-class-ref in main-a39d3a.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How to tell compiler to import calculator.h file although I have included the following line in main.m:
#import "Calculator.h"
Calculator.mon the compile line so it gets linked withmain.m.