Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug error : Unity.IL2CPP.Building.BuilderFailedException: Lump_libil2cpp_icalls.cpp

Discussion in 'AR' started by VizworxInc, Nov 30, 2022.

  1. VizworxInc

    VizworxInc

    Joined:
    May 9, 2018
    Posts:
    2
    I am trying to port an existing working project (PCVR, desktop and Oculus Quest 2) to HoloLens 2 with MRTK.

    I am using the current LTS:
    - Unity 2021.3.14f1 (although it did the same on 2021.3.19)
    - Visual Studio 2022 - 17.4.1 (although it also fails on VS 2019 - 16.11.21)
    - Windows 10
    The code all seems fine, and I can use Unity MRTK Build Window to Build Unity Project. I then go into that project and try to build and get a lot of errors in the generated code. It looks like the generation is somehow wrong.

    I have looked around, updated to Unity 2021.3.14, went back to VS 2019, but I haven't found anything that solves this.

    I also tried adding (as per https://forum.unity.com/threads/il2cpp-error-on-building-for-windows.1351589/):
    #define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
    #include <hash_map>

    My build output is:
    Code (CSharp):
    1. Build started...
    2. 1>------ Build started: Project: Il2CppOutputProject, Configuration: Release ARM64 ------
    3. 1>Building GameAssembly.dll with MsvcWinRtToolChain
    4. 1>    Msvc Install Version: 17.0
    5. 1>    Msvc Install SDK Directory: C:\Program Files (x86)\Windows Kits\10
    6. 1>    Msvc Linker Path: e:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\ARM64\link.exe
    7. 1>    Msvc Compiler Path: e:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\ARM64\cl.exe
    8. 1>
    9. 1>    Output directory: ProjRoot\Builds\WSAPlayer\build\bin\ARM64\Release
    10. 1>    Cache directory: ProjRoot\Builds\WSAPlayer\build\obj\il2cppOutputProject\ARM64\Release
    11. 1>EXEC : error : Unity.IL2CPP.Building.BuilderFailedException: Lump_libil2cpp_icalls.cpp
    12. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Diagnostics\Debugger.cpp(29): error C2227: left of '->chars' must point to class/struct/union/generic type
    13. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Diagnostics\Debugger.cpp(29): note: type is 'Il2CppString **'
    14. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.h(21): error C2059: syntax error: '('
    15. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.h(21): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    16. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.h(21): error C2059: syntax error: 'constant'
    17. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.cpp(46): error C2146: syntax error: missing ')' before identifier 'p'
    18. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.cpp(46): error C2065: 'p': undeclared identifier
    19. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.cpp(46): error C2761: 'int il2cpp::icalls::mscorlib::System::Runtime::RuntimeImports::memset(void)': redeclaration of member is not allowed
    20. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.cpp(46): error C2059: syntax error: 'constant'
    21. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.cpp(46): error C2059: syntax error: ')'
    22. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.cpp(47): error C2143: syntax error: missing ';' before '{'
    23. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.cpp(47): error C2447: '{': missing function header (old-style formal list?)
    24. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls/mscorlib/System.Threading/Thread.h(51): error C2061: syntax error: identifier '_ARM64_BARRIER_SY'
    25. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Threading\Thread.cpp(309): error C2761: 'void il2cpp::icalls::mscorlib::System::Threading::Thread::__dmb(void)': redeclaration of member is not allowed
    26. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Threading\Thread.cpp(310): error C2143: syntax error: missing ';' before '{'
    27. 1>ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Threading\Thread.cpp(310): error C2447: '{': missing function header (old-style formal list?)
    28. 1>
    29. 1>Invocation was: Executable: "e:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\ARM64\cl.exe"
    30. 1>Arguments: "ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\Source\lumpedcpp\Lump_libil2cpp_icalls.cpp" /nologo /c /bigobj /W3 /Z7 /EHs /GR- /Gy /utf-8 /wd4102 /wd4800 /wd4056 /wd4190 /wd4723 /wd4467 /wd4503 /wd4996 /wd4200 /wd4834 /wd4722 /Ox /Oi /Oy- /GS- /Gw /GF /Zo /MD -d2ssa-cfg-jt-
    31.     /DWINDOWS_UWP /DUNITY_UWP /DUNITY_WSA_10_0 /DUNITY_WSA /DUNITY_WINRT /DPLATFORM_WINRT /DNET_4_0 /DUNITY_AOT /DIL2CPP_MONO_DEBUGGER_DISABLED /DGC_NOT_DLL /DRUNTIME_IL2CPP /DIL2CPP_ENABLE_WRITE_BARRIERS=1 /DIL2CPP_INCREMENTAL_TIME_SLICE=3 /DBASELIB_INLINE_NAMESPACE=il2cpp_baselib
    32.     /DIL2CPP_DEFAULT_DATA_DIR_PATH=Data/il2cpp_data /DBASELIB_USE_DYNAMICLIBRARY=1 /D_WIN32 /DWIN32 /DWIN32_THREADS /D_WINDOWS /DWINDOWS /D_UNICODE /DUNICODE /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /D_WINSOCK_DEPRECATED_NO_WARNINGS /DNOMINMAX /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
    33.     /D_NDEBUG /DNDEBUG /DWINDOWS_SDK_BUILD_VERSION=22621 /D__WRL_NO_DEFAULT_LIB__ /DWINAPI_FAMILY=WINAPI_FAMILY_APP /I"ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp" /I"ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp"
    34.     /I"ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\external\bdwgc\include" /I"ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\external\xxHash" /I"ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\external\baselib\Include"
    35.     /I"ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\external\baselib\Platforms\UniversalWindows\Include" /I"ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\IL2CPP\libil2cpp\pch" /I"e:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include"
    36.     /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\winrt" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt"
    37.     /Fo"ProjRoot\Builds\WSAPlayer\build\obj\il2cppOutputProject\ARM64\Release\libil2cpp\E60350126A18C533AE15D2A0702C57EE.obj" /Fd"ProjRoot\Builds\WSAPlayer\build\obj\il2cppOutputProject\ARM64\Release\libil2cpp\E60350126A18C533AE15D2A0702C57EE.pdb"
    38. 1>EnvArg key: PATH value: C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86;
    39.     C:\Program Files (x86)\Windows Kits\10\bin\x86;e:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64
    40. 1>
    41. 1>   at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
    42. 1>   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    43. 1>   at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, ReadOnlyCollection`1 matchedAssemblyMethodSourceFiles)
    44. 1>   at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, Boolean throwExceptions)
    45. 1>e:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(45,5): error MSB3073: The command ""ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\\IL2CPP\build\deploy\il2cpp.exe" --libil2cpp-static --compile-cpp
    46.    -architecture=ARM64 -configuration=Release -platform=winrt -outputpath="ProjRoot\Builds\WSAPlayer\\build\bin\ARM64\Release\GameAssembly.dll" --data-folder="ProjRoot\Builds\WSAPlayer\\build\bin\ARM64\Release\\"
    47.    -cachedirectory="ProjRoot\Builds\WSAPlayer\\build\obj\il2cppOutputProject\ARM64\Release\\" -generatedcppdir="ProjRoot\Builds\WSAPlayer\Il2CppOutputProject\\Source"  --incremental-g-c-time-slice=3
    48.    --baselib-directory="E:\Program Files\Unity\Hub\Editor\2021.3.14f1\Editor\Data\PlaybackEngines\MetroSupport\Players\UAP\il2cpp\ARM64\Release" --avoid-dynamic-library-copy --dont-deploy-baselib --profiler-report --additional-defines=WINDOWS_UWP
    49.    --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityaot-win32 -verbose --relative-data-path=Data/il2cpp_data --compiler-flags="-d2ssa-cfg-jt-"" exited with code 4.
    50. 1>Done building project "Il2CppOutputProject.vcxproj" -- FAILED.
    51. 2>------ Build started: Project: HoloLens2Test2, Configuration: Release ARM64 ------
    52. 2>HoloLens2Test2.vcxproj -> ProjRoot\Builds\WSAPlayer\build\bin\ARM64\Release\HoloLens2Test2.exe
    53. ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    54. ========== Elapsed 00:05.590 ==========
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    Do you have AppCenterSDK in your project by any chance? We have seen this issue with it: it injects its own code to our code and that causes it to not compile. You can workaround it by deleting the call to "FixIl2CppLogging" function in AppCenter\Editor\AppCenterPostBuild.cs.
     
    VizworxInc likes this.
  3. VizworxInc

    VizworxInc

    Joined:
    May 9, 2018
    Posts:
    2
    Yes! Thanks so much!

    I have to admit that I really didn't want to deal with asking such an obscure question and not getting anything useful, but that fixes my issue and relieves a lot of frustration!
     
  4. ratford2

    ratford2

    Joined:
    Dec 17, 2021
    Posts:
    1
    I am having that same issue.
    I created a new clean file.
    Only a cube in the file.
    Followed the tutorial : https://learn.microsoft.com/en-us/training/paths/beginner-hololens-2-tutorials/
    Unity: 2021.3.11f1
    Properly set up the file.
    It builds like it should.
    Open the Solution in Visual Studio Professional 2022 17.4.4
    I have tried several versions of Unity from 2020.3.18f1 to 2021.3.11f1.
    I tried Visual Studio Community 2019 16.11.23
    Nothing seems to help.
    As far as I can tell I am not using AppCenterSDK
    I searched for AppCenterPostBuild.cs and it is not on my computer.
    I am running Windows 10 Pro V. 21H2 build 19044.2130 ErrorList.jpg Output.jpg Output.jpg
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
  6. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    232
    Hi, the issue persists with Unity 2022.3.20 + AppCenter. The workaround with commenting FixIl2CppLogging still works.
    You'll need to delete the whole UWP project and rebuild with Unity.
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    Yes, that isn't a bug in Unity but rather inside AppCenter SDK. Updating Unity will not fix it. The poster above (ratford2) was running into a different issue.