Friday, September 13, 2013

Undefined symbols for architecture ... Build Error

Sometimes we get the below error while building a project in XCode. It's not very troublesome, but sometimes we forget how to fix it:

Undefined symbols for architecture x86_64:

  "_OBJC_CLASS_$_", referenced from:
      _OBJC_CLASS_$_VariableOne in ClassOne.o
      _OBJC_CLASS_$_VariableTwo in ClassTwo.o
          ...
  "_OBJC_METACLASS_$_IpcObject", referenced from:
      _OBJC_METACLASS_$_VariableOne in ClassOne.o
      _OBJC_METACLASS_$_VAriableTwo in ClassTwo.o
      ...

This error shows usually because the compiler build doesn't recognise the mentioned object file( in the above error log. 

Fixing this could be as simple as adding the .m file in the "Compile Sources" list in the Project Settings > Build Phases page

No comments:

Post a Comment