Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Bug IL2CPP build problem

Discussion in '2020.2 Beta' started by Rowlan, Oct 26, 2020.

  1. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,536
    Just posting this here instead of bumping the thread in archive. I got this problem during IL2CPP build:

    Code (CSharp):
    1. Cannot open include file: 'string.h': No such file or directory
    Could it be made more obvious that the C++ Workload needs to be installed? Or would it be possible to have it installed implicitly? Without the thread above I wouldn't have had any idea that I'd need to install that. I didn't find anything about it in the documentaiton either.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Unfortunately we don't have a great way to detect this case. The C++ compiler is installed - that we can detect and error properly if it is not installed - but part of the SDK is missing here. So we don't have many better error message options.
     
  3. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,536
    Maybe adding common pitfalls to the documentation here could help as well?

    https://docs.unity3d.com/Manual/IL2CPP.html

    That forum thread will be deleted. So permanent information could be very helpful.
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Yes, that might not be a bad idea.
     
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    We've been discussing this issue at bit here, and if you are willing, we would love some help understanding what state the Visual Studio and C++ workloads are in on your computer. That might help us better detect this issue.

    For example, do you have a string.h file some where around this path?

    "C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\string.h"

    Of course, if you have installed the Windows 10 SDK already, then maybe things are working now and we can't gather more information about your configuration. But I wanted to ask anyway.
     
  6. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,536
    No, the file wan't there. I already fixed it by installing the C++ workload, so can't give you any more details unfortunately. But here's what I did when I installed VS2019:

    * had VS2017, uninstalled it
    * installed VS2019
    * added some .NET versions
    * added Unity Hub

    I didn't install anything C++ related. I was under the impression I wouldn't have to because Unity would have everything it needs. I'm noob in that regard.

    What I notice now is that the Unity stuff isn't installed, it isn't ticked, i. e. "Spieleentwicklung mit Unity". I was under the impression that I did that. I could debug after all.

    Unfortunately my VS2019 installer is german and I have no idea how to change that, I'd very much like to. Anyway, these are the settings I have now:

    install.png
    I ticked "Desktopentwicklung mit C++", after that and the implicit installation everything worked and the IL2CPP compilation was successful. These are the details of my now working installation in case it helps:

    vs 1.png
    vs 2.png
     
    KarlKarl2000 likes this.
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Thanks for all of these details. I'll open a bug report internally to track this. We should improve the error message when this Visual Studio installation workflow happens.
     
    KarlKarl2000 and Rowlan like this.
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    LeonhardP and Rowlan like this.
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,756
    I think what happened was that uninstalling VS2017 left some things behind. Unity found those things and assumed Windows SDK was already installed (by checking only registry keys and not the existence of actual files) so it went through our normal SDK checks just fine. And then we launched the compiler, and it led to you getting that error.

    We'll fix it.
     
    Deozaan and Rowlan like this.
  10. Nefahl

    Nefahl

    Joined:
    Feb 20, 2017
    Posts:
    82
    Are there any news regarding this issue? I get exactly the same error after updating from vs17 to vs19. I even uninstalled visual studio, and unity completetly, installed both from the hub and still get this error. After that I manually added all the packages shown in the image above, still getting the error, this is so frustrating, doing nothing but uninstalling/installing packages a whole day, not being able to fix this error.

    The mentioned path above:
    "C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\string.h"
    is available, but Unity doesn't seem to be able to find it there?!

    Is there some cache folder to delete to clear the mentioned leftovers, which wasn't cleared when uninstalling vs/unity in appdata or sth, which I could try to clear?

    Edit: Turned out that Unity2021.9.f1 isn't looking for 10.0.18362.0, but for 10.0.20348.0, which wasn't installed with VS19 when installing together with the editor (at least not when it was uninstalled before it seems), also many there weren't installed like the workload package aswell as the Windows Universal C-Runtime. Maybe it helps fixing the issue.
     
    Last edited: Sep 21, 2021
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,756
    We have vastly improved installation detection and error messages in Unity 2021.2. If you haven't fixed your issue yet, you might want to give the 2021.2 beta a shot to see if it behaves better.
     
    Nefahl likes this.
  12. Nefahl

    Nefahl

    Joined:
    Feb 20, 2017
    Posts:
    82
    It works now the version mismatch was causing my issue, but thanks for the notice, sounds great for VS updates in the future :)
     
  13. longsl

    longsl

    Joined:
    Feb 12, 2019
    Posts:
    2
    This problem disappeared when I installed the C++ Desktop Development Kit
     
  14. alapsoni

    alapsoni

    Joined:
    Nov 15, 2016
    Posts:
    1
    hey bro, what issue did you faced here ?
    Actually i am building an android game and play store
    needs 64bit support that il2cpp provides
    but my game is crashing after 9-10 minutes of play