Link errors: symbol(s) not found(转)

本文分享了一个在iPhone应用开发过程中遇到的AudioToolbox链接错误解决方案。通过正确链接AudioToolbox框架,解决了编译时出现的未定义符号错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天在编写《iphone3开发教程》中第七章的内容时,突然被一个错误搞晕了,改了好多地方都没成功,后来想在网上查查,结果还都是英文!庆幸的是,读懂了某一篇段,还真改正了过来,链接无误。下面和大家分享一下吧!

错误源:在试图控制器中,想应用AudioToolbox类中的函数AudioServicesCreateSystemSoundID输出声音,虽然已添加了头文件,但是链接时却出现了错误:

Ld build/Debug-iphonesimulator/Pickers.app/Pickers normal i386

cd /Users/wang/Documents/Pickers

setenv MACOSX_DEPLOYMENT_TARGET 10.6

setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk -L/Users/wang/Documents/Pickers/build/Debug-iphonesimulator -F/Users/wang/Documents/Pickers/build/Debug-iphonesimulator -filelist /Users/wang/Documents/Pickers/build/Pickers.build/Debug-iphonesimulator/Pickers.build/Objects-normal/i386/Pickers.LinkFileList -mmacosx-version-min=10.6 -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/wang/Documents/Pickers/build/Debug-iphonesimulator/Pickers.app/Pickers

 

Undefined symbols:

  "_AudioServicesCreateSystemSoundID", referenced from:

      -[SingleController playwithSound] in SingleController.o

      -[SingleController spin] in SingleController.o

  "_AudioServicesPlaySystemSound", referenced from:

      -[SingleController playwithSound] in SingleController.o

      -[SingleController spin] in SingleController.o

ld: symbol(s) not found

collect2: ld returned 1 exit status

 

看到这么长的错误,虚了吧?不用害怕,其实解决的办法很简单!AudioToolbox不属于uikit框架,我们必须把项目链接到调用的函数所属于的框架中。在xcode左侧的group&files列表中,右击framworks文件,选择exiting frameworks,选择AudioToolbox.framworks之后再编译运行就没错了。


 下面简单说一下FrameWork。它是一些类的集合,通常是一些可能一起使用的类集合.换句话说,这些类被一起编译成可复用的代码库(library of code)。所有相关的资源和代码库一起放入一个带扩展名“.framework”的目录(Mac OSX bundle 的概念可以参考苹果的一些文档). 系统自带的framework可以在/System/Library/Frameworks找到. 几个基本的framworks:

 

          1. Foundation: 所有的面向对象语言都会有一些标准结构: value , collection , String, dates, lists, thread等等.所有的这些都在Foundation framework里面(可以对比C++的STL)

          2. Appkit: 所有和用户界面相关的类都在这里. Windows,buttons,text field, event, drawing. 它还有个名字: ApplicationKit

          3. Core Data: Core Data可以方便的让你把你的对象存储成文件,或是从文件中加载你的对象.

              供稿者  sunshine

 

 

转自:  http://hi.baidu.com/herozoo/blog/item/2603653caef8c5d69f3d6231.html

Traceback (most recent call last): File "G:\JYBB\CY\优快云1.py", line 12, in <module> if browser.find_element(By.CSS_SELECTOR,"span.username-text").text != "登录": ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\JYBB\.venv\Lib\site-packages\selenium\webdriver\remote\webelement.py", line 109, in text return self._execute(Command.GET_ELEMENT_TEXT)["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\JYBB\.venv\Lib\site-packages\selenium\webdriver\remote\webelement.py", line 572, in _execute return self._parent.execute(command, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\JYBB\.venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 429, in execute self.error_handler.check_response(response) File "G:\JYBB\.venv\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 232, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: stale element not found (Session info: chrome=134.0.6998.165); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception Stacktrace: GetHandleVerifier [0x00007FF68AC64C25+3179557] (No symbol) [0x00007FF68A8C88A0] (No symbol) [0x00007FF68A7591CA] (No symbol) [0x00007FF68A76F5C4] (No symbol) [0x00007FF68A76E093] (No symbol) [0x00007FF68A7618C1] (No symbol) [0x00007FF68A75F632] (No symbol) [0x00007FF68A763BCC] (No symbol) [0x00007FF68A763C9F] (No symbol) [0x00007FF68A7A96A6] (No symbol) [0x00007FF68A7D7C2A] (No symbol) [0x00007FF68A7A22D6] (No symbol) [0x00007FF68A7D7E40] (No symbol) [0x00007FF68A8002F3] (No symbol) [0x00007FF68A7D7A03] (No symbol) [0x00007FF68A7A06D0] (No symbol) [0x00007FF68A7A1983] GetHandleVerifier [0x00007FF68ACC67CD+3579853] GetHandleVerifier [0x00007FF68ACDD1D2+3672530] GetHandleVerifier [0x
03-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值