解决symbol(s) not found for architecture x86_64报错
来源:互联网 发布:微软雅黑bold for mac 编辑:程序博客网 时间:2024/05/22 03:05
今天在引入一个第三方的拍照选择照片的库时,编译报错。
Undefined symbols for architecture x86_64: "_ALAssetPropertyAssetURL", referenced from: -[TZImageManager getAssetIdentifier:] in TZImageManager.o "_ALAssetPropertyDuration", referenced from: ___90-[TZImageManager getAssetsFromFetchResult:allowPickingVideo:allowPickingImage:completion:]_block_invoke139 in TZImageManager.o ___97-[TZImageManager getAssetFromFetchResult:atIndex:allowPickingVideo:allowPickingImage:completion:]_block_invoke in TZImageManager.o "_ALAssetPropertyType", referenced from: ___90-[TZImageManager getAssetsFromFetchResult:allowPickingVideo:allowPickingImage:completion:]_block_invoke139 in TZImageManager.o ___97-[TZImageManager getAssetFromFetchResult:atIndex:allowPickingVideo:allowPickingImage:completion:]_block_invoke in TZImageManager.o "_ALAssetPropertyURLs", referenced from: -[TZImageManager getVideoWithAsset:completion:] in TZImageManager.o -[TZImageManager isAssetsArray:containAsset:] in TZImageManager.o "_ALAssetTypeVideo", referenced from: ___90-[TZImageManager getAssetsFromFetchResult:allowPickingVideo:allowPickingImage:completion:]_block_invoke139 in TZImageManager.o ___97-[TZImageManager getAssetFromFetchResult:atIndex:allowPickingVideo:allowPickingImage:completion:]_block_invoke in TZImageManager.o "_ALAssetsGroupPropertyName", referenced from: ___66-[TZImageManager getCameraRollAlbum:allowPickingImage:completion:]_block_invoke in TZImageManager.o ___60-[TZImageManager getAllAlbums:allowPickingImage:completion:]_block_invoke in TZImageManager.o "_OBJC_CLASS_$_ALAsset", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_ALAssetsFilter", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_ALAssetsGroup", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_ALAssetsLibrary", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHAsset", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHAssetCollection", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHAssetCreationRequest", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHAssetResourceCreationOptions", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHCachingImageManager", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHFetchOptions", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHFetchResult", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHImageManager", referenced from: objc-class-ref in TZAssetCell.o objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHImageRequestOptions", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHPhotoLibrary", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHVideoRequestOptions", referenced from: objc-class-ref in TZImageManager.o "_PHImageCancelledKey", referenced from: ___58-[TZImageManager getPhotoWithAsset:photoWidth:completion:]_block_invoke in TZImageManager.o ___55-[TZImageManager getOriginalPhotoWithAsset:completion:]_block_invoke in TZImageManager.o "_PHImageErrorKey", referenced from: ___58-[TZImageManager getPhotoWithAsset:photoWidth:completion:]_block_invoke in TZImageManager.o ___55-[TZImageManager getOriginalPhotoWithAsset:completion:]_block_invoke in TZImageManager.o "_PHImageManagerMaximumSize", referenced from: -[TZImageManager getOriginalPhotoWithAsset:completion:] in TZImageManager.o "_PHImageResultIsDegradedKey", referenced from: ___58-[TZImageManager getPhotoWithAsset:photoWidth:completion:]_block_invoke in TZImageManager.o ___58-[TZImageManager getPhotoWithAsset:photoWidth:completion:]_block_invoke_2 in TZImageManager.o "_PHImageResultIsInCloudKey", referenced from: ___58-[TZImageManager getPhotoWithAsset:photoWidth:completion:]_block_invoke in TZImageManager.old: symbol(s) not found for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)
经过几个小时的查资料,和尝试,基本上确定了是由于部分依赖的框架没有导入(天知道为什么会没有导入,我在另一个项目里面直接拖进去就可以编译的,坑爹的xcode)。
于是我仔细看了下报错的内容,都是指向TZImageManager,于是我到对应的.m文件里面,发现它引用了系统的AssetsLibrary
框架:我尝试手动导入这个框架:
编译一下,原来报27个错,现在只有17个了,看来有效果。于是我继续找还缺少了什么框架。现在的报错如下:
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_PHAsset", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHAssetCollection", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHAssetCreationRequest", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHAssetResourceCreationOptions", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHCachingImageManager", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHFetchOptions", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHFetchResult", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHImageManager", referenced from: objc-class-ref in TZAssetCell.o objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHImageRequestOptions", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHPhotoLibrary", referenced from: objc-class-ref in TZImageManager.o "_OBJC_CLASS_$_PHVideoRequestOptions", referenced from: objc-class-ref in TZImageManager.o "_PHImageCancelledKey", referenced from: ___58-[TZImageManager getPhotoWithAsset:photoWidth:completion:]_block_invoke in TZImageManager.o ___55-[TZImageManager getOriginalPhotoWithAsset:completion:]_block_invoke in TZImageManager.o "_PHImageErrorKey", referenced from: ___58-[TZImageManager getPhotoWithAsset:photoWidth:completion:]_block_invoke in TZImageManager.o ___55-[TZImageManager getOriginalPhotoWithAsset:completion:]_block_invoke in TZImageManager.o "_PHImageManagerMaximumSize", referenced from: -[TZImageManager getOriginalPhotoWithAsset:completion:] in TZImageManager.o "_PHImageResultIsDegradedKey", referenced from: ___58-[TZImageManager getPhotoWithAsset:photoWidth:completion:]_block_invoke in TZImageManager.o ___58-[TZImageManager getPhotoWithAsset:photoWidth:completion:]_block_invoke_2 in TZImageManager.o "_PHImageResultIsInCloudKey", referenced from: ___58-[TZImageManager getPhotoWithAsset:photoWidth:completion:]_block_invoke in TZImageManager.old: symbol(s) not found for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)
当时在看这个报错的时候,一头雾水,PHxxx的库根本找不到,于是在.m里面找,半天之后猜是不是
Photos
框架,导入了之后编译成功!
猜得很艰辛啊。
现在写这个文章的时候,突然发现对应的TZImageManager.h文件里果然导入了Photos
框架……
猜得那么辛苦,原来.h里面就有答案,醉了。
解决这个问题花了一个下午的时间,写一篇文章做个备份,免得下次又被坑。
阅读全文
0 0
- 解决symbol(s) not found for architecture x86_64报错
- 解决 Mac OS X 下 Nginx 编译报错 symbol(s) not found for architecture x86_64
- 解决 Mac OS X 下 openrestry 编译报错 symbol(s) not found for architecture x86_64
- symbol(s) not found for architecture x86_64
- 关于报错ld: symbol(s) not found for architecture x86_64不是代码问题
- [iOS]编译报错:ld: symbol(s) not found for architecture x86_64
- Mavericks boost ld: symbol(s) not found for architecture x86_64
- ld: symbol(s) not found for architecture x86_64
- ld: symbol(s) not found for architecture x86_64
- error: symbol(s) not found for architecture x86_64
- Symbol(s) not found for architecture X86_64问题解决
- ld: symbol(s) not found for architecture x86_64问题解决
- Error:referenced from;symbol(s) not found for architecture x86_64解决
- symbol(s) not found for architecture i386
- symbol(s) not found for architecture armv7
- symbol(s) not found for architecture i386
- symbol(s) not found for architecture arm64
- symbol(s) not found for architecture arm64
- 参考教程地址
- i++与++i是一样的吗?
- 软件工程作业--03 黄金点游戏
- Java发展史
- uva170
- 解决symbol(s) not found for architecture x86_64报错
- centos 6.8 下python2.6 升级python2.7,安装pip工具
- Unity相机自身围绕(第一人称视角)
- fragment+viewpager+侧拉
- 自定义 标题栏
- spring jaxb Object XML转换
- tf.train.batch()
- MP4转.JPG
- 当年校招时,我就死在这个问题上...