Xcode给出了Apple Mach-O链接器错误 [英] Xcode gives Apple Mach-O linker error

查看:348
本文介绍了Xcode给出了Apple Mach-O链接器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚编译了一个项目,Xcode返回了这两个错误,这似乎不是我的代码的错.我该如何解决?

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)

推荐答案

教男人(或女人)如何钓鱼:

Teaching a man (or women) how to fish:

通常,Mach-O链接器错误表示您没有在代码中包含要使用的功能的头文件.

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

最简单的方法是使用shift + command + O复制该函数或方法调用并粘贴到Xcode快速搜索中.这将搜索所有框架(和头文件),找到该函数或方法调用,并向您显示其位置(在本例中为头):

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):

在这种情况下,此调用属于Accelerate框架,因此在文件顶部输入:

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

#import <Accelerate/Accelerate.h>

进行快速搜索时,您可能必须摆脱下划线.换句话说,搜索vImageBoxConvolve_ARGB8888

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

希望这会有所帮助

这篇关于Xcode给出了Apple Mach-O链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆