Search code examples
iosxcodeframeworksmach-o

Mach-O Error using drawGlossAndGradient()


Got this error:

Undefined symbols for architecture i386:
"_drawGlossAndGradient", referenced from:
  -[CustomHeader drawRect:] in CustomHeader.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

With this code:

drawGlossAndGradient(context, _coloredBoxRect, lightColor, darkColor);

A similar error happens with this bit of code:

CGMutablePathRef arcPath = createArcPathFromBottomOfRect(arcRect, 4.0);

I imported some .h and .m files out of another project which works fine. I added all frameworks to the new project but it still pops out this warning. I never dealt with this kind of error and would be grateful if someone could help me.

Thank you all!


Solution

  • Just add CoreGraphics.framework to your project.

    Actually, you don't need add any #import <CoreGraphics/CoreGraphics.h> in your file. You should add the framework like it's: