I tried to build and run my first project for Google Cardboard in Xcode.
I first encountered something that basically said my signature was incorrect and asked me to sign in so that the computer could fix it (which it seemed to). (I include this info in case it is related to the error in some way.)
I then encountered the error Unknown type name '__declspec'
and have no idea how to fix it.
This issue is also found here but there are no answers to it. A Google search yielded about 50 results, so it seems relatively uncommon.
What would be my best course of action?
I have a fix for if you can't upgrade to the Unity version that fixes this.
Find the 3 files in the Unity application called il2cpp-codegen.h. For example, on Mac Unity, they're here:
/Applications/Unity5.1.4/Unity.app/Contents/PlaybackEngines/WebGLSupport/BuildTools/Libraries/libil2cpp/include/codegen/il2cpp-codegen.h
/Applications/Unity5.1.4/Unity.app/Contents/PlaybackEngines/iossupport/il2cpp/libil2cpp/include/codegen/il2cpp-codegen.h
/Applications/Unity5.1.4/Unity.app/Contents/Frameworks/il2cpp/libil2cpp/codegen/il2cpp-codegen.h
Find this line in those:
NORETURN static void il2cpp_codegen_raise_exception (Il2CppCodeGenException *ex)
Delete the "NORETURN" from each, and save the files. It should work now.
Unity just released a new version, 5.3.2, to deal with this issue.
I had a similar issue in a library that embed a C++ dll.
If you don't want to upgrade I believe you can replace:
#define NORETURN __declspec(noreturn)
by
#define NORETURN __attribute__((noreturn))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With