Can you try a clean build? When the file format of main.o is not regocnized it might just be corrupted somehow...
Thanks but the same thing happened ld 1 error again on main.o
Fixed it !!
main.c was getting compiled twice (see above) and the build was failing. To fix it. (1) Removed main.c/main.h from the project (2) Cleaned and re-built the project (this would fail). (3) Put main.c and main.h back into the project. Then it built fine.
Thanks for the help