Search code examples
c++objective-cdjinni

"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. 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.

I am seeing 4 errors all of which are "Use of undeclared identifier '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. 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.


Solution

  • Updated c++ Language dialect to -std=c++14 fixed the issue