如何编译支持arm64的dylib

各位大神请教一个问题。
我在10.9.3上,使用xcode 5.1.1编译。

1、archs Standard architectures(armv7,armv7s,arm64)
only_active_arch NO
valid_archs armv7 armv7s arm64

编译的时候会出现很多这样的错误
Undefined symbols for architecture arm64:
“_smbc_getFunctionMkdir”, referenced from:
+[KxSMBProvider createFolderAtPath:] in libKxSMB.a(KxSMBProvider.o)

我经过搜索,尝试了使用把archs 修改为 armv7 armv7s,
这样,编译能通过,但是无论用file 还是lipo 命令查看,这个dylib都是不支持
命令行查看:
bodeMac:~ bozhang$ file /Users/bozhang/Library/Developer/Xcode/DerivedData/testDylib-acfuykuxgfddargbpybhwydwkrvo/Build/Products/Debug-iphoneos/testDylib.dylib
/Users/bozhang/Library/Developer/Xcode/DerivedData/testDylib-acfuykuxgfddargbpybhwydwkrvo/Build/Products/Debug-iphoneos/testDylib.dylib: Mach-O dynamically linked shared library arm
bodeMac:~ bozhang$ lipo -info /Users/bozhang/Library/Developer/Xcode/DerivedData/testDylib-acfuykuxgfddargbpybhwydwkrvo/Build/Products/Debug-iphoneos/testDylib.dylib
Non-fat file: /Users/bozhang/Library/Developer/Xcode/DerivedData/testDylib-acfuykuxgfddargbpybhwydwkrvo/Build/Products/Debug-iphoneos/testDylib.dylib is architecture: armv7s

手机输出的:
Oct 3 13:00:46 iPhone-johnny mstreamd[448] : MS:Notice: Loading: /Library/MobileSubstrate/DynamicLibraries/testDylib.dylib
Oct 3 13:00:46 iPhone-johnny mstreamd[448] : MS:Error: dlopen(/Library/MobileSubstrate/DynamicLibraries/testDylib.dylib, 9): no suitable image found. Did find:
/Library/MobileSubstrate/DynamicLibraries/testDylib.dylib: mach-o, but wrong architecture

2、还找到另外一个帖子,archs等不改变。
把Build Settings --------Linking ------MACH_O_TYPE 从dynamic Library 修改为Static Library。
这样编译出来的dylib,支持arm64.但是放入设备以后,运行
出现这样的错误

Oct 3 13:10:09 iPhone-johnny afcd[442] : MS:Notice: Loading: /Library/MobileSubstrate/DynamicLibraries/testDylib.dylib
Oct 3 13:10:09 iPhone-johnny mstreamd[440] : MS:Notice: Loading: /Library/MobileSubstrate/DynamicLibraries/testDylib.dylib
Oct 3 13:10:09 iPhone-johnny afcd[442] : MS:Error: dlopen(/Library/MobileSubstrate/DynamicLibraries/testDylib.dylib, 9): no suitable image found. Did find:
/Library/MobileSubstrate/DynamicLibraries/testDylib.dylib: unknown file type, first eight bytes: 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A
Oct 3 13:10:09 iPhone-johnny mstreamd[440] : MS:Error: dlopen(/Library/MobileSubstrate/DynamicLibraries/testDylib.dylib, 9): no suitable image found. Did find:
/Library/MobileSubstrate/DynamicLibraries/testDylib.dylib: unknown file type, first eight bytes: 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A

请教请教。该如何操作??

从这里看上去,是你调用的第三方库不支持arm64

大狗神,经过仔细的检查,是我的库有问题。 这是封装的第三层库。 第一层他不支持arm64 。多谢!!