How to get rid of "Unknown type name" __declspec "error in Xcode

I tried to create and run my first Google Cardboard project in Xcode.

At first, I came across something that basically says that my signature is incorrect and asked me to log in so that the computer can fix it (which seemed). (I include this information if it is somehow related to the error.)

Then I ran into the Unknown type name '__declspec' and have no idea how to fix it.

This problem is also found here , but there are no answers to it. A Google search returned about 50 results, so it seems pretty unusual.

What will be my best course of action?

+6
source share
4 answers

Unity has just released a new version, 5.3.2, to solve this problem.

+2
source

I have a fix if you cannot upgrade the version of Unity that fixes this.

Locate the 3 files in the Unity app called il2cpp-codegen.h. For example, on Mac Unity, they are located 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 the following words:

 NORETURN static void il2cpp_codegen_raise_exception (Il2CppCodeGenException *ex) 

Remove "NORETURN" from each and save the files. Now it should work.

+15
source

I had a similar problem in a library that embeds a C ++ dll.

If you do not want to update, I believe that you can replace:

 #define NORETURN __declspec(noreturn) 

 #define NORETURN __attribute__((noreturn)) 
+1
source

For each file that throws an error, you should remove NORETURN from only these lines.

But sometimes this is not a NORETURN problem, but you need to remove IL2CPP_NO_INLINE .

This should solve the problem.

0
source

All Articles