我的环境
Xcode6.2
ffmpeg是2.6.2,支持arm64 armv7,i386,x86_64
我的测试分两块.
ffmpeg和音视频数据以静态库方式封装好(工程名:libH264)
上层是界面上的UI(工程名:TestH264)
Valid Architectures = arm64 armv7 i386 (支持模拟器和最新设备)
由于用到了FFmpeg,Header Search Paths 中要指定ffmpeg的include路径
同时工程添加ffmpeg的7个.a文件(曾经没有做这一步,TestH264中一直提示找不到ffmppeg库函数)
以下是编译TestH264工程遇到问题(注意在编译libH264库是不会有以下问题的.)
问题1.
"_BZ2_bzDecompressInit", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
"_BZ2_bzDecompressEnd", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
"_BZ2_bzDecompress", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
————————————————这要添加 libbz2.1.0.dylib
问题2.
Undefined symbols for architecture armv7:
"___gxx_personality_v0", referenced from:
"_deflate", referenced from:
"_deflateEnd", referenced from:
"_deflateInit2_", referenced from:
"_inflate", referenced from:
"_inflateEnd", referenced from:
"_inflateInit2_", referenced from:
————————————————这要添加 libstdc++.dylib libz.1.1.3.dylib
问题3.
Undefined symbols for architecture i386:
"_SCError", referenced from:
-[Reachability startNotifier] in Reachability.o
"_SCErrorString", referenced from:
-[Reachability startNotifier] in Reachability.o
"_SCNetworkReachabilityCreateWithAddress", referenced from:
+[Reachability reachabilityWithAddress:] in Reachability.o
"_SCNetworkReachabilityCreateWithName", referenced from:
+[Reachability reachabilityWithHostname:] in Reachability.o
"_SCNetworkReachabilityGetFlags", referenced from:
-[Reachability isReachable] in Reachability.o
-[Reachability isReachableViaWWAN] in Reachability.o
-[Reachability isReachableViaWiFi] in Reachability.o
-[Reachability connectionRequired] in Reachability.o
-[Reachability isConnectionOnDemand] in Reachability.o
-[Reachability isInterventionRequired] in Reachability.o
-[Reachability reachabilityFlags] in Reachability.o
————————————————这要添加 SystemConfiguration.framework Security.framework CFNetwork.framework
armv7 , armv7s对应真机的32位处理器;armv7 就是iphone4s,iphone4, armv7s就是iphone5,iphone5c
i386对应模拟器的32位模拟器;
arm64对应真机的64位模拟器arm64就是iphone5s以上设备
x86_64对应模拟器的64位模拟器。
Xcode6.2
ffmpeg是2.6.2,支持arm64 armv7,i386,x86_64
我的测试分两块.
ffmpeg和音视频数据以静态库方式封装好(工程名:libH264)
上层是界面上的UI(工程名:TestH264)
libH264工程配置
Build Active Architecure Only = NO (最好都是NO, 按release版本处理)Valid Architectures = arm64 armv7 i386 (支持模拟器和最新设备)
由于用到了FFmpeg,Header Search Paths 中要指定ffmpeg的include路径
同时工程添加ffmpeg的7个.a文件(曾经没有做这一步,TestH264中一直提示找不到ffmppeg库函数)
以下是编译TestH264工程遇到问题(注意在编译libH264库是不会有以下问题的.)
问题1.
"_BZ2_bzDecompressInit", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
"_BZ2_bzDecompressEnd", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
"_BZ2_bzDecompress", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
————————————————这要添加 libbz2.1.0.dylib
问题2.
Undefined symbols for architecture armv7:
"___gxx_personality_v0", referenced from:
"_deflate", referenced from:
"_deflateEnd", referenced from:
"_deflateInit2_", referenced from:
"_inflate", referenced from:
"_inflateEnd", referenced from:
"_inflateInit2_", referenced from:
————————————————这要添加 libstdc++.dylib libz.1.1.3.dylib
问题3.
Undefined symbols for architecture i386:
"_SCError", referenced from:
-[Reachability startNotifier] in Reachability.o
"_SCErrorString", referenced from:
-[Reachability startNotifier] in Reachability.o
"_SCNetworkReachabilityCreateWithAddress", referenced from:
+[Reachability reachabilityWithAddress:] in Reachability.o
"_SCNetworkReachabilityCreateWithName", referenced from:
+[Reachability reachabilityWithHostname:] in Reachability.o
"_SCNetworkReachabilityGetFlags", referenced from:
-[Reachability isReachable] in Reachability.o
-[Reachability isReachableViaWWAN] in Reachability.o
-[Reachability isReachableViaWiFi] in Reachability.o
-[Reachability connectionRequired] in Reachability.o
-[Reachability isConnectionOnDemand] in Reachability.o
-[Reachability isInterventionRequired] in Reachability.o
-[Reachability reachabilityFlags] in Reachability.o
————————————————这要添加 SystemConfiguration.framework Security.framework CFNetwork.framework
最后TestH264加入的工程 Frameworks:如下图
libH264.a文件还需要加入的Frameworks. 如下图
armv7 , armv7s对应真机的32位处理器;armv7 就是iphone4s,iphone4, armv7s就是iphone5,iphone5c
i386对应模拟器的32位模拟器;
arm64对应真机的64位模拟器arm64就是iphone5s以上设备
x86_64对应模拟器的64位模拟器。