在 Xcode 中使用 djinni 时"use of undeclared identifier" 'noreturn'
"use of undeclared identifier" 'noreturn' when using djinni in xcode
我正在使用一个名为 djinni 的库,它连接到我的 iOS 代码,并允许我在 iOS 和 Android 中运行相同的 c++ 代码。 我遇到的问题是我已将其附加到我正在处理的旧 xcode 项目中,并且在 djinni 代码中出现错误。
我看到 4 个错误,所有错误都是"使用未声明的标识符'noreturn'"
可以看到这些示例的一个例子是:
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
带有"[[noreturn]]"的两行都会引发此错误。是否有我忽略的项目设置?我的 main.m 已重命名为 main.mm,所有 djinni 编译源代码都添加了 -fobjc-arc。
将 c++ 语言方言更新为 -std=c++14 修复了此问题
相关文章:
- ld:bind_at_load和-bitcode_bundle(Xcode设置ENABLE_bitcode=YES)不能
- 在没有Xcode的情况下在Mac捆绑包中嵌入框架
- 我看到"use of undeclared identifier"错误,有人可以告诉我如何解决它吗?
- Xcode 语义问题引用或以前定义的代码
- 使用 Xcode 将双精度存储在数组C++中
- Xcode 9.4.1 中的 Apple Mach-O 链接器 (id) 错误
- 消除"Undeclared identifier"错误
- 各种版本的 Mac OSX 向后兼容性如何?(Xcode C++
- MacOS 上的 Xcode 11 项目不在一个函数中使用 sin 和 cos:未定义的符号"___sincosf_stret"
- macOS 是内置在 clang 编译器中还是内置于 xcode ide 中?
- Qt - 从XCode上传到MacOS AppStore
- 在 xcode 10 上找不到 stdlibc++ 标头错误
- cmake add_custom_command + Xcode:多输出 = 多命令调用
- 为什么即使在定义之后仍存在"Identifier is undefined error "?
- 在 xcode 上使用 stdlib.h
- 我可以在没有Xcode的情况下在Mac上使用带有C++的虚幻引擎吗?
- 为什么不支持 Xcode 1.5?
- C++ Xcode 9 - 无法从 Cimg 调用函数 display()
- 在 Xcode 中使用 djinni 时"use of undeclared identifier" 'noreturn'
- 如何在Xcode中将长双精度转换为字符串格式?或如何解决错误"use of undeclared identifier 'to_string' "