Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode gives Apple Mach-O linker error

Tags:

I just compiled a project and Xcode returns these two errors which don't seem to be my code's fault. How do I fix them?

Undefined symbols for architecture i386:   "_vImageBoxConvolve_ARGB8888", referenced from:       -[UIImage(Blur) boxblurImageWithBlur:] in UIImage+Blur.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) 
like image 798
kuranes Avatar asked Jul 01 '13 22:07

kuranes


1 Answers

Teaching a man (or women) how to fish:

Usually Mach-O Linker Error means you have not included a header file for a function you are using in your code.

Easiest way is to copy that function or method call and paste into Xcode quick search using shift+command+O. This will search all frameworks (and header files), find that function or method call and show you its location (the header in this case):

In this case, this call belongs to the Accelerate framework so on top of your file, enter:

#import <Accelerate/Accelerate.h> 

When doing quick search, you might have to get rid of leading underscore. In other words, search for vImageBoxConvolve_ARGB8888

Hope this helps

like image 106
Khaled Barazi Avatar answered Sep 30 '22 05:09

Khaled Barazi