加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

iphone – 调用AudioServicesPlaySystemSound时有2个错误?

发布时间:2020-12-14 19:00:22 所属栏目:百科 来源:网络整理
导读:我正在制作一个应用程序,一旦计时器达到一定的限制振动. 但是,在打电话时 AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); Xcode出现两个错误: Undefined symbols for architecture i386: "_AudioServicesPlaySystemSound",referenced from: -[draw
我正在制作一个应用程序,一旦计时器达到一定的限制振动.

但是,在打电话时

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

Xcode出现两个错误:

Undefined symbols for architecture i386:
  "_AudioServicesPlaySystemSound",referenced from:
      -[drawGraph drawRect:] in drawGraph.o
ld: symbol(s) not found for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)

有关导致这些错误的原因的任何想法?

解决方法

如果您只是不必添加头文件,如上所示,必须在项目中添加框架.你应该在下面的标题. #import< AudioToolbox / AudioToolbox.h>

  1. In Xcode,click your project file at the top of the Project Navigator.

  2. Click ‘YourProjectName’ under “Targets”

  3. Click the “Build Phases” tab.

  4. Click the plus in the “Link Binary With Libraries” window.

  5. Add the AudioToolbox.Framework library

  6. Add #import <AudioToolbox/AudioToolbox.h>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读