CAF转换MP3的lame库编译问题解决

首先给出lame库的地址:http://download.csdn.net/detail/ysy441088327/4174609

作者博客:http://blog.csdn.net/ysy441088327/article/details/7392842


最近在使用lame库将CAF转换为MP3时遇到一个编译错误,此时的模拟器处于64bit位环境下,错误如下:

ld: warning: ignoring file /Users/apple/Desktop/论文批阅系统/论文批阅系统/libmp3lame.a, missing required architecture x86_64 in file /Users/apple/Desktop/论文批阅系统/论文批阅系统/libmp3lame.a (3 slices)
Undefined symbols for architecture x86_64:
  "_lame_close", referenced from:
      -[VoiceAnnotation convertCAFtoMP3] in VoiceAnnotation.o
  "_lame_encode_buffer_interleaved", referenced from:
      -[VoiceAnnotation convertCAFtoMP3] in VoiceAnnotation.o
  "_lame_encode_flush", referenced from:
      -[VoiceAnnotation convertCAFtoMP3] in VoiceAnnotation.o
  "_lame_init", referenced from:
      -[VoiceAnnotation convertCAFtoMP3] in VoiceAnnotation.o
  "_lame_init_params", referenced from:
      -[VoiceAnnotation convertCAFtoMP3] in VoiceAnnotation.o
  "_lame_set_VBR", referenced from:
      -[VoiceAnnotation convertCAFtoMP3] in VoiceAnnotation.o
  "_lame_set_in_samplerate", referenced from:
      -[VoiceAnnotation convertCAFtoMP3] in VoiceAnnotation.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command fai

解决方法如下:

首先打开工程 —— Build Settings,找到Architectures选项,修改如下:



补一张图:


将Standard architectures(including 64-bit)(armv7, armv7s, arm64)选项改为上面的Standard architectures(armv7, armv7s)就可以了。


再Build或者Run就没问题了。


顺便科普一下:

armv6、armv7、armv7s是arm CPU的指令集,一般是向下兼容的。如iPhone4sCPU支持armv7,但它会兼容armv6,只是使用armv6指令可能无法充分发挥它的特性。同理iPhone5是完全支持armv7的,所以不用担心armv7的库不能在iPhone5上跑,一般情况是不会出问题的。但需要提醒的是,苹果是自Xcode4.5之后,就放弃了对armv6的支持,换言之,就是Xcode4.5正常情况是不能编译armv6库的(当然据说通过特殊手段可以支持,之前在网有看到一些在神的帖子,感兴趣的可以搜搜)。

arm64,应该就是新推出的armv8了。

个人看来是该库并不支持arm64架构,产生了和64位不兼容的问题,所以出现了编译错误。


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值