Xcode 11.1编译时出现Photos框架错误

3
我已将Xcode 10.3升级到最新版本的Xcode11.1,并在我的项目中添加了相册框架。当我运行我的项目时,在PHImageManager.h类中出现“Photos requires C++11 or later”的错误。下面是错误信息:
错误: 1./Applications/xcode11/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.1.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h:18:2:“Photos requires C++11 or later” 2./Applications/xcode11/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.1.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h:21:47: 预期标识符或'{'
请帮我解决这个问题。
2个回答

3

进入构建设置(Build Settings),然后将C++语言方言(C++ Language Dialect)更改为GNU++11 [-std=gnu++11]可解决问题。

enter image description here


找不到这个设置。它在哪里? - testing
在上方添加了一张图片。 - da1
谢谢更新。所以这是一个项目特定的设置。我以为它是通用的。因为我使用Xamarin,所以我不能使用它。 - testing

0

/Applications中编辑一个文件? - trojanfoe
完整路径/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h。在这里,您需要将typedef NS_ENUM(NSInteger, UIImageOrientation);更改为typedef NS_ENUM(NSInteger, UIImageOrientation){}; - Рустам Райфинов

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接