简体   繁体   English

在xcode中使用djinni时,“使用未声明的标识符”'noreturn'

[英]“use of undeclared identifier” 'noreturn' when using djinni in xcode

I am using a library called djinni, it connects to my iOS code and allows me to run the same c++ code in both iOS and Android. 我正在使用一个名为djinni的库,它连接到我的iOS代码,并允许我在iOS和Android中运行相同的c ++代码。 the issue I am having is I have attached it to an old xcode project I am working on and I get errors in the djinni code. 我遇到的问题是我已将其附加到我正在处理的旧xcode项目中,并且在djinni代码中出现错误。

I am seeing 4 errors all of which are "Use of undeclared identifier 'noreturn'" 我看到4个错误,所有错误都是“使用未声明的标识符'noreturn'”

An example of where these can be seen is: 可以看到这些的示例是:

namespace djinni {

// Throws an exception for an unimplemented method call.
[[noreturn]] void throwUnimplemented(const char * ctx, NSString * msg);

// Helper function for exception translation. Do not call directly!
[[noreturn]] void throwNSExceptionFromCurrent(const char * ctx);

} // namespace djinni

Both of the lines with "[[noreturn]]" throw this error. 带有“ [[noreturn]]”的两行均引发此错误。 Is there a project setting I have overlooked? 是否有我忽略的项目设置? my main.m has been renamed main.mm, and all of the djinni compile sources have the -fobjc-arc added. 我的main.m已重命名为main.mm,并且所有djinni编译源均添加了-fobjc-arc。

将c ++语言方言更新为-std = c ++ 14解决了该问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM