0

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.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
saxford
  • 23
  • 5
  • Are you using `-std=c++11` or later? (Objective-C++ is a bit of a hybrid language.) – Eljay Jan 31 '19 at 14:28
  • Hi, I have c++ language dialect set to GNU++14[-std=gnu++14] and c++ standard Library set to libc++ (LLVM c++ standard library with C++11 support) – saxford Jan 31 '19 at 16:13
  • It compiles on my machine, `/usr/bin/clang++ -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -std=gnu++17 -ObjC++ -fobjc-arc -c Saxford.mm` (also works with `-std=c++17`) – Eljay Jan 31 '19 at 18:09
  • Check the version of Xcode and clang you're using? Is it not the latest? Sounds like it doesn't understand the annotations being used here. – Andrew Feb 02 '19 at 01:29

1 Answers1

0

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

saxford
  • 23
  • 5