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

iphone – 调用AudioServicesPlaySystemSound时有2个错误?,第1张

概述我正在制作一个应用程序,一旦计时器达到一定的限制振动. 但是,在打电话时 AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); Xcode出现两个错误: Undefined symbols for architecture i386: "_AudioServicesPlaySystemSound", referenced from: 我正在制作一个应用程序,一旦计时器达到一定的限制振动.

但是,在打电话时

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

Xcode出现两个错误:

Undefined symbols for architecture i386:  "_AudioServicesPlaySystemSound",referenced from:      -[drawGraph drawRect:] in drawGraph.old: 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>

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

Click ‘YourProjectname’ under “Targets”

Click the “Build Phases” tab.

Click the plus in the “link Binary With librarIEs” window.

Add the AudioToolBox.Framework library

Add #import <AudioToolBox/AudioToolBox.h>

总结

以上是内存溢出为你收集整理的iphone – 调用AudioServicesPlaySystemSound时有2个错误?全部内容,希望文章能够帮你解决iphone – 调用AudioServicesPlaySystemSound时有2个错误?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1037666.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存