Search Unity

IL2CPP fatal error C1001: Internal compiler error.

Discussion in 'Editor & General Support' started by Gulliver, Aug 1, 2021.

  1. Gulliver

    Gulliver

    Joined:
    Jan 8, 2013
    Posts:
    101
    Hello. Faced this error while building the project.

    Exception: Unity.IL2CPP.Building.BuilderFailedException: Assembly-CSharp.cpp
    C:\Program Files\Unity\Hub\Editor\2021.1.15f1\Editor\Data\il2cpp\libil2cpp\codegen\il2cpp-codegen-il2cpp.h(229) : fatal error C1001: Internal compiler error.
    (compiler file 'd:\a01\_work\3\s\src\vctools\Compiler\Utc\src\p2\main.c', line 213)
    To work around this problem, try simplifying or changing the program near the locations listed above.

    What am I supposed to do about it?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,736
    Try deleting the IL2CPP cache. It's located in a folder under Library, in your project adjacent to Assets and ProjectSettings. I don't have the exact name handy but its a pretty obvious name. Close Unity first, then open and rebuild.
     
  3. Gulliver

    Gulliver

    Joined:
    Jan 8, 2013
    Posts:
    101
    Already tried before. Did not help.
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @Gulliver

    What player platform is this build error from?
     
  5. Gulliver

    Gulliver

    Joined:
    Jan 8, 2013
    Posts:
    101
    Windows x86_64, Unity 2021.1.15f1
     
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Thanks for the details. This usually is caused by a bug in the Microsoft C++ compiler, unfortunately. You may want to ensure that you have the latest version of Visual Studio installed, as the compiler issue might be corrected.

    Also, we've seen compiler issues like this before when the "C++ Compiler Configuration" Player Settings option is "Master", often because link time optimization is enabled. If that is the case for your project, can you attempt to instead build it in the "Release" configuration? That might work around the issue.
     
    Silrider likes this.
  7. Gulliver

    Gulliver

    Joined:
    Jan 8, 2013
    Posts:
    101
    Just installed VS 2019 before to build IL2CPP.

    "Release" is set now
     
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Can you send us a project that reproduces this issue in a bug report? We might be able to come up with a work around.
     
  9. Gulliver

    Gulliver

    Joined:
    Jan 8, 2013
    Posts:
    101
    It's a really big one. Around 100Gb. How?
     
  10. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Wow, that is pretty big. It might be too big for our bug reporter to accept. If you are willing to share it, we could obtain is separately though (maybe via Google Drive or something).