`
cuichang
  • 浏览: 92759 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

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

阅读更多

今天在编写《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

分享到:
评论

相关推荐

    Key was created with errors: Warning: JKS 密钥库使用专用格式。android Studio打包报错

    Key was created with errors: Warning: JKS 密钥库使用专用格式。建议使用 “keytool -importkeystore -srckeystore E:\lvchuang\lvchuang.jks -destkeystore E:\lvchuang\lvchuang.jks -deststoretype pkcs12” ...

    ver.dll File Not Found, Missing File, Exception Errors

    ver.dll是Windows版本检测应用程序接口相关文件。 没有它常见错误: File Not Found, Missing File, Exception Errors

    ethtool-3.9 下载

    Ethtool是Linux下用于查询及设置网卡参数的命令。 概要: ethtool ethX //查询ethX网口基本...tx_heartbeat_errors: 0 tx_window_errors: 0 4)[root@linux /]# ethtool -s eth1 autoneg off speed 100 duplex full

    Programmers’ Build Errors: A Case Study (at Google)

    Programmers’ Build Errors: A Case Study (at Google)

    linux 网络诊断常用命令.pdf

     rx_errors: 0  tx_errors: 0  tx_dropped: 0  multicast: 0  collisions: 0  rx_length_errors: 0  rx_over_errors: 0  rx_crc_errors: 0  rx_frame_errors: 0  rx_no_buffer_count: 0  rx_missed_...

    Rocks_automatic_partitioning_errors

    This can happen if there is not enough space on your hard drive s for the installation Press ‘OK’ to exit the installer ">Rocks automatic partitioning errors The following errors occurred with your...

    pyassimp动态库.rar

    遵照上述文章步骤,但无需用cmake编译对应版本。 将下列库文件放入pip install pyassimp安装路径下 (例如:E:\Python37\Lib\site-packages\pyassimp 即可用import pyassimp调用(如不能调用请用pip uninstall ...

    Unity MySql所需要的DLL

    里面包含I18N.CJK.dll,I18N.dll,I18N.West.dll,mysql.data.dll,System.Data.dl

    ajv-errors:Ajv验证程序的JSON模式中的自定义错误消息

    ajv-errors v3支持 。 如果您使用的是ajv v6,则应使用 内容 支持者,企业支持,安全联系人 执照 安装 npm install ajv-errors 用法 将关键字errorMessages添加到Ajv实例: const Ajv = require ( "ajv" ) . ...

    log-process-errors:向Node.js进程显示一些:red_heart:错误

    log-process-errors修复了所有这些问题。 没有log-process-errors : 随着log-process-errors : 用例 正确记录生产中的过程错误。 调试开发中的过程错误。 自动化测试过程错误。 演示版 您可以尝试以下库:

    japi-errors::high_voltage:RESTful和HTTP服务的可自定义错误

    安装Gradlecompile ' io.github.cdimascio:japi-errors:1.3.1 ' 玛文< dependency> < groupId>io.github.cdimascio</ groupId> < artifactId>japi-errors</ artifactId> < version>1.3.1</ version></ dependency>...

    http-errors:创建HTTP错误

    使用完成 : $ npm install http-errors例子var createError = require ( 'http-errors' )var express = require ( 'express' )var app = express ( )app . use ( function ( req , res , next ) { if ( ! req . ...

    nodeerrors:node.js中的错误处理

    节点错误 这是一个用于在node.js更有效地处理错误的库,特别是为像我这样的人创建的,他们大多数时候使用函数... message : "The property \"%s\" is not unique. The value \"%s\" already exists." , args : [

    pylint-errors:精心设计的pylint错误列表以及说明和示例

    $ python3 -m pip install pipx # if not yet installed pipx $ python3 -m pipx ensurepath # ensure directory where pipx stores apps is on PATH $ pipx install plerr $ plerr r1710 开发版本 为了使用开发...

    unigui0.83.5.820

    - 0000784: TUniStringGrid: Data not restored after decreasing/increasing Row count - 0000788: Bug in Grid Row/Col translation - 0000787: UniDBGrid: Broken CellSelect behavior - 0000786: MessageDlg ...

    http-errors:HTTP异常的通用软件包

    class NotFound extends Error { const httpStatus = 404 ; } 与其为每个客户端和服务器端项目进行一遍又一遍的处理,更有意义的是创建一个可以在我正在处理的每个项目中重复使用的通用程序包。 我很难在NPM上...

    WISC-R examiner errors: Cause for concern

    WISC-R examiner errors: Cause for concern 78 Janet G. Melancon and Bruce Thompson WICKER, T. E. (1980, Sept.). The effects of cognitive dissonance or disequilibrium on conservation attain- ment ...

    errors:升级的错误类型

    具有额外的属性: notFound : true status :404 .EncodingError() 编码数据时出错。 贡献Level/errors是OPEN开源项目。 这意味着: 做出重大和有价值贡献的个人将获得对项目的承诺访问权,以按照自己的意愿进行...

    errors:标准库错误包和github.compkgerrors的直接替换

    标准库errors包和。 这是一个轻量级的库,它合并了标准库errors包和。 它还会向后移植一些功能(例如与Go 1.13错误处理相关的功能)。 标准库功能: New会产生堆栈跟踪错误 Unwrap支持Go 1.13包装器( interface...

    graphql-errors:GraphQL Ruby的简单错误处理程序

    graphql错误 :warning: 不推荐使用该gem,而建议使用graphql gem中的新GraphQL::Execution::Errors 。 查看更多详细信息 。 这个gem为提供了简单的错误处理。强调每个字段的错误处理。 与Rails类似, rescue_from块...

Global site tag (gtag.js) - Google Analytics