1

After i included a custom badge files into my project, project is failing to build with the following error. Note, that there are not syntax errors anywhere, such as missing includes etc.

enter image description here

What may be going on here please? Clean succeeded. Build failed.

Header file for the class i included contains:

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>

Note that needed frameworks are included:

enter image description here

Also, i tried removing/ adding frameworks from the project, that did not seem to do anything to help with this issue.


ANSWERED:

Make sure to include the files you just added into the project by going to Targets -> Build Phases

enter image description here

Community
  • 1
  • 1
James Raitsev
  • 92,517
  • 154
  • 335
  • 470

1 Answers1

1

You need to add both the CustomBadge.h and CustomBadge.m files into your project when you build it, otherwise all you have is a declaration of a class without the corresponding definition, this is what leads to an error like this. It is, in essence telling you that you have told it to expect the implementation by #importing the .h file, but if you don't bring along the .m file then it will be unable to make use of it.

Anya Shenanigans
  • 91,618
  • 3
  • 107
  • 122
  • The reason why you don't need to add the QuartzCore framework is because the CoreGraphics framework references it - http://stackoverflow.com/questions/1877987/whats-the-difference-between-quartz-core-core-graphics-and-quartz-2d – Anya Shenanigans Mar 19 '12 at 00:47