Undefined symbols for architecture armv7: "_UnityGetDataContextEAGL" after switching from mono to il2cpp.

I had Unity 3D code created in Unity 4.3, that I imported to Unity 5 in order to support arm64 archtecture for iOS. After switching from Mono to IL2CPP backend scripting and exporting code for iOS, I am errors of Undefined symbols for many unity based files. It was working fine in Mono.

I am beginner in Unity. Is there any change in Unity code is needed to migrate from Mono to IL2CPP? If Yes, share some useful codes and links.

Following are some errors and please see ScreenShot for more info :

“_UnityGetDataContextEAGL”, referenced from:
ContextGLES::Create(int) in libiPhone-lib-il2cpp-dev.a(ContextGLES.o)
“_UnityInitMainScreenRenderingCallback”, referenced from:
ContextGLES::Create(int) in libiPhone-lib-il2cpp-dev.a(ContextGLES.o)
CreateMetalGfxDevice() in libiPhone-lib-il2cpp-dev.a(GfxDeviceMetal.o)
“_UnityGetMetalCommandQueue”, referenced from:
metal::StartFrameRendering() in libiPhone-lib-il2cpp-dev.a(FrameBufferMetal.o)
“_UnityGfxInitedCallback”, referenced from:
_UnityInitApplicationGraphics in libiPhone-lib-il2cpp-dev.a(LibEntryPoint.o)
“_mono_domain_assembly_open”, referenced from:
pluginInit() in UnityCallBack.o
“_mono_assembly_get_image”, referenced from:
pluginInit() in UnityCallBack.o
“_UnityGetMetalBundle”, referenced from:
_CreateRenderingSurfaceMTL in MetalHelper.o
_CreateSharedDepthbufferMTL in MetalHelper.o
InitMetalSupport() in libiPhone-lib-il2cpp-dev.a(MetalSupport.o)
“_mono_method_desc_new”, referenced from:
pluginInit() in UnityCallBack.o
“_mono_method_desc_search_in_image”, referenced from:
pluginInit() in UnityCallBack.o
“_mono_domain_get”, referenced from:
pluginInit() in UnityCallBack.o

There should be no changes necessary in your code to switch from the Mono scripting backend to the IL2CPP scripting backend.

I’m not specifically familiar with the cause of these linker errors, so I’ll make a few general suggestions to help troubleshoot the cause.

  1. You can build for iOS 64-bit with Unity version 4.6.4. If you 4.3 project more easily migrates to 4.6 than is does to 5.0, you might want to try 4.6.4.
  2. It looks like you might have something left over from 4.3 somewhere, as the errors are indicative of recent changes to support Metal (e.g. the missing _UnityGetMetalCommandQueue symbol) and the IL2CPP scripting backend (e.g. the missing _mono_domain_assembly_open symbol, which should now be the more general _scripting_domain_assembly_open). Can you try to build an empty project for the IL2CPP scripting backend?
  3. Do you have the source code used to generate the UnityCallBack.o file? I don’t think that file comes from Unity (although I might be wrong). It looks like that file is not going to work correctly with the IL2CPP scripting backend, since it references mono_ functions directly.