Hi everyone, I’m getting an error when building with IL2CPP that I’m having a hard time figuring out:
I had a few errors leading up to this, but after adding the C++ Game libraries to Visual Studio 2022, clearing the IL2CPP cache and ensuring the “Compiler Configuration” is not set to Master… well this shows up.
Am I missing anything obvious here?
I remember an issue in our game before where we had a huge hard-coded array that IL2CPP couldn’t handle; but that’s been taken care of, and the exact same project builds just fine on another device.
Exception: Unity.IL2CPP.Building.BuilderFailedException: Generics67.cpp
D:\.Data\Unity\CinQ\Library\Il2cppBuildCache\Windows\x64\il2cppOutput\Generics67.cpp(32375) : fatal error C1001: Internal compiler error.
(compiler file 'd:\a01\_work\4\s\src\vctools\Compiler\Utc\src\p2\main.c', line 220)
To work around this problem, try simplifying or changing the program near the locations listed above.
If possible please provide a repro here: https://developercommunity.visualstudio.com
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
cl!RaiseException()+0x6c
cl!RaiseException()+0x6c
cl!InvokeCompilerPassW()+0x7da8b
cl!InvokeCompilerPassW()+0x11d325
Invocation was: Executable: "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\cl.exe"
Arguments: "D:\.Data\Unity\CinQ\Library\Il2cppBuildCache\Windows\x64\il2cppOutput\Generics67.cpp" /nologo /c /bigobj /W3 /Z7 /EHs /GR- /Gy /utf-8 /wd4102 /wd4800 /wd4056 /wd4190 /wd4723 /wd4467 /wd4503 /wd4996 /wd4200 /wd4834 /Ox /Oi /Oy- /GS- /Gw /GF /Zo /Yupch-cpp.hpp /Fp"D:\.Data\Unity\CinQ\Library\il2cpp_cache\606504B0802361776F234EA9FE0A85B8.pch" /MT /DNET_4_0 /DUNITY_AOT /DIL2CPP_MONO_DEBUGGER_DISABLED /DGC_NOT_DLL /DRUNTIME_IL2CPP /DBASELIB_INLINE_NAMESPACE=il2cpp_baselib /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_NDEBUG /DNDEBUG /DWINDOWS_SDK_BUILD_VERSION=22000 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\libil2cpp" /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\libil2cpp" /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\external\bdwgc\include" /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\external\xxHash" /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\external\baselib\Include" /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\external\baselib\Platforms\Windows\Include" /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\libil2cpp\pch" /I"D:\.Data\Unity\CinQ\Library\Il2cppBuildCache\Windows\x64\il2cppOutput" /I"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\shared" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\winrt" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt" /Fo"D:\.Data\Unity\CinQ\Library\il2cpp_cache\7E6CEC28F79AE538C3E2697846E23077.obj" /Fd"D:\.Data\Unity\CinQ\Library\il2cpp_cache\7E6CEC28F79AE538C3E2697846E23077.pdb"
EnvArg key: PATH value: C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64
at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions, ReadOnlyCollection`1 matchedAssemblyMethodSourceFiles)
at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions, Boolean throwExceptions)
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditorInternal.IL2CPPBuilder.Run () (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <44c3723143904fb88deebc993c7bb491>:0)
DesktopStandalonePostProcessor.RunIL2CPP (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, System.Collections.Generic.List`1[T] cppPlugins) (at <44c3723143904fb88deebc993c7bb491>:0)
DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at <44c3723143904fb88deebc993c7bb491>:0)
DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <44c3723143904fb88deebc993c7bb491>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditor.BuildPipeline:BuildPlayer(String[], String, BuildTarget, BuildOptions)
DLS.CinQ.Build.CinQBuilderBase:BuildZoneServer(String, String, BuildTarget, BuildOptions, String) (at Assets/_Scripts/Build/Editor/CinQBuilderBase.cs:102)
DLS.CinQ.Build.CinQBuilder_LocalDev:BuildZoneServer() (at Assets/_Scripts/Build/Editor/CinQBuilder_LocalDev.cs:91)
DLS.CinQ.Build.Editor.CinQBuilderWindows:OnGUI() (at Assets/_Scripts/Build/Editor/CinQBuilderWindows.cs:61)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Try to update to the latest Visual Studio 2022 preview version, if you have not done so yet. We had a similar compiler error come up internally, which Microsoft corrected:
Looks like you’re missing Windows SDK. Maybe VS version upgrade accidentally nuked it? For what it’s worth, I recently made this error message much better. You can install Windows SDK either through VS installer or directly from Windows SDK - Windows app development | Microsoft Developer.
OK, that actually seems to make sense!
I manually changed the version in the registry following what I found here https://discussions.unity.com/t/791127 and I’m no longer getting the above error!
That version it was trying to use was the Windows 11 SDK; so there might be some sort of compatibility issue where Unity can’t deal with the Windows 11 SDK even though it is set as the “default” in the registry (since it has the highest version number?). Either that or Visual Studio Installer is just not changing the registry value as it should upon removing that SDK version.
The bad news? I’m mack to the first error once again…
Exception: Unity.IL2CPP.Building.BuilderFailedException: Generics67.cpp
D:\.Data\Unity\CinQ\Library\Il2cppBuildCache\Windows\x64\il2cppOutput\Generics67.cpp(32375) : fatal error C1001: Internal compiler error.
(compiler file 'D:\a\_work\1\s\src\vctools\Compiler\Utc\src\p2\main.c', line 220)
To work around this problem, try simplifying or changing the program near the locations listed above.
If possible please provide a repro here: https://developercommunity.visualstudio.com
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
cl!RaiseException()+0x6c
cl!RaiseException()+0x6c
cl!InvokeCompilerPassW()+0x81bdf
cl!InvokeCompilerPassW()+0x120297
Invocation was: Executable: "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31114\bin\HostX64\x64\cl.exe"
Arguments: "D:\.Data\Unity\CinQ\Library\Il2cppBuildCache\Windows\x64\il2cppOutput\Generics67.cpp" /nologo /c /bigobj /W3 /Z7 /EHs /GR- /Gy /utf-8 /wd4102 /wd4800 /wd4056 /wd4190 /wd4723 /wd4467 /wd4503 /wd4996 /wd4200 /wd4834 /Ox /Oi /Oy- /GS- /Gw /GF /Zo /Yupch-cpp.hpp /Fp"D:\.Data\Unity\CinQ\Library\il2cpp_cache\980709334C9FBE073A3C33E38462060B.pch" /MT /DNET_4_0 /DUNITY_AOT /DIL2CPP_MONO_DEBUGGER_DISABLED /DGC_NOT_DLL /DRUNTIME_IL2CPP /DBASELIB_INLINE_NAMESPACE=il2cpp_baselib /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_NDEBUG /DNDEBUG /DWINDOWS_SDK_BUILD_VERSION=20348 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\libil2cpp" /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\libil2cpp" /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\external\bdwgc\include" /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\external\xxHash" /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\external\baselib\Include" /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\external\baselib\Platforms\Windows\Include" /I"D:\.Data\Unity\2020.3.15f2\Editor\Data\il2cpp\libil2cpp\pch" /I"D:\.Data\Unity\CinQ\Library\Il2cppBuildCache\Windows\x64\il2cppOutput" /I"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31114\include" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\shared" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\winrt" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\ucrt" /Fo"D:\.Data\Unity\CinQ\Library\il2cpp_cache\59349731DD859407DB37E593D457AE44.obj" /Fd"D:\.Data\Unity\CinQ\Library\il2cpp_cache\59349731DD859407DB37E593D457AE44.pdb"
EnvArg key: PATH value: C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31114\bin\HostX64\x64
at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions, ReadOnlyCollection`1 matchedAssemblyMethodSourceFiles)
at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions, Boolean throwExceptions)
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditorInternal.IL2CPPBuilder.Run () (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <44c3723143904fb88deebc993c7bb491>:0)
DesktopStandalonePostProcessor.RunIL2CPP (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, System.Collections.Generic.List`1[T] cppPlugins) (at <44c3723143904fb88deebc993c7bb491>:0)
DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at <44c3723143904fb88deebc993c7bb491>:0)
DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <44c3723143904fb88deebc993c7bb491>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <44c3723143904fb88deebc993c7bb491>:0)
UnityEditor.BuildPipeline:BuildPlayer(String[], String, BuildTarget, BuildOptions)
DLS.CinQ.Build.CinQBuilderBase:BuildZoneServer(String, String, BuildTarget, BuildOptions, String) (at Assets/_Scripts/Build/Editor/CinQBuilderBase.cs:105)
DLS.CinQ.Build.CinQBuilder_LocalDev:BuildZoneServer() (at Assets/_Scripts/Build/Editor/CinQBuilder_LocalDev.cs:91)
DLS.CinQ.Build.Editor.CinQBuilderWindows:OnGUI() (at Assets/_Scripts/Build/Editor/CinQBuilderWindows.cs:61)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
I’m currently running the latest preview that seems available:
And I currently have the following SDKs installed (with the Gaming, Desktop and Mobile development with C++ workloads installed), and am pointing to version 10.0.20348 through the registry (as described above):
Also, if it matters at all, this is a relatively fresh install of Windows 11; so I really haven’t had time to mess anything up; it’s basically just Unity, Visual Studio, Notepad++, FileZilla and some game launchers.
Darn it, this is probably a different compiler error then. Can you try various different options for the C++ Compiler Configuration setting in the Unity Editor Player Settings? It might be nice to know if any option there changes the behavior.
Also, when this does happen, was is the generated code in D:.Data\Unity\CinQ\Library\Il2cppBuildCache\Windows\x64\il2cppOutput\Generics67.cpp around line 32375, where the C++ compiler indicates the cause of the problem might be?
I’m guessing I also need to include something linux-specific in the Visual Studio installation options?
It’s almost like I forgot to mention I was building the game server… which runs on Linux XD EDIT: Yep, the build is now going through! I’ll make sure things are working, but it should all be good now!
Also, just in case it is still relevant, here is the code from that Generic67.cpp file (starting at line 32374)
Ok, so the problem here does look like a bug specific to the MSVC compiler, which is only used for the Linux build. If you only need the Linux build, then it seems you can work around it.
Hi, sorry if I was a bit confusing there; unfortunately I currently need to build multiple versions of the game: a game server running on Linux, and game clients for Android, Mac OS and Windows.
Only the Windows version seems to be causing issues at the moment; I’m using Mono as a fallback for now, but the whole team is supposed to shift to IL2CPP so I’m eventually going to have to change that.
@EricLowry
To clarify, all the obfuscation that was triggering the compiler errors was removed from Rewired in version 1.1.40.0. The current version of Rewired is 1.1.41.5. If you are getting this error, you need to update Rewired.