# IL2CPP build problem (814267)

**URL:** <https://discussions.unity.com/t/il2cpp-build-problem-814267/814267>\
**Category:** Scripting\
**Tags:** Bug, 2020.2-beta\
**Created:** [October 26, 2020, 11:40am UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267 "2020-10-26T11:40:01Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rowlan](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/rowlan/32/613887_2.png) [@Rowlan](https://discussions.unity.com/u/Rowlan)\
**Post date:** [October 26, 2020, 11:40am UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/1 "2020-10-26T11:40:01Z")

</div>

Just posting this here instead of bumping [the thread in archive](https://discussions.unity.com/t/791485/4) . I got this problem during IL2CPP build:

```csharp
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.

---

<div class="post-metadata">

**Author:** ![JoshPeterson](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/joshpeterson/32/44179_2.png) [@JoshPeterson](https://discussions.unity.com/u/JoshPeterson)\
**Post date:** [October 26, 2020, 12:28pm UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/2 "2020-10-26T12:28:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Rowlan](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/rowlan/32/613887_2.png) [@Rowlan](https://discussions.unity.com/u/Rowlan)\
**Post date:** [October 26, 2020, 12:59pm UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/3 "2020-10-26T12:59:21Z")

</div>

> [@JoshPeterson](#):
>
> 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.

Maybe adding common pitfalls to the documentation here could help as well?

[https://docs.unity3d.com/Manual/IL2CPP.html](https://docs.unity3d.com/Manual/IL2CPP.html)

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

---

<div class="post-metadata">

**Author:** ![JoshPeterson](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/joshpeterson/32/44179_2.png) [@JoshPeterson](https://discussions.unity.com/u/JoshPeterson)\
**Post date:** [October 26, 2020, 1:43pm UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/4 "2020-10-26T13:43:07Z")

</div>

Yes, that might not be a bad idea.

---

<div class="post-metadata">

**Author:** ![JoshPeterson](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/joshpeterson/32/44179_2.png) [@JoshPeterson](https://discussions.unity.com/u/JoshPeterson)\
**Post date:** [October 26, 2020, 2:50pm UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/5 "2020-10-26T14:50:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Rowlan](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/rowlan/32/613887_2.png) [@Rowlan](https://discussions.unity.com/u/Rowlan)\
**Post date:** [October 26, 2020, 3:58pm UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/6 "2020-10-26T15:58:02Z")

</div>

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:

 ![6458698--724006--install.png](https://europe1.discourse-cdn.com/unity/original/3X/2/e/2e4853ad358c08638bd039b9e26dec44d2a1388f.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:

 ![6458698--724009--vs 1.png](https://europe1.discourse-cdn.com/unity/original/4X/e/d/9/ed9ca0df50cd9a8dfce719f8e3db8d9c6f16f09c.png)  
 ![6458698--724012--vs 2.png](https://europe1.discourse-cdn.com/unity/original/4X/0/6/e/06e211d40b7b3f9e95b5a38d764021abcc9bc18a.png)

---

<div class="post-metadata">

**Author:** ![JoshPeterson](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/joshpeterson/32/44179_2.png) [@JoshPeterson](https://discussions.unity.com/u/JoshPeterson)\
**Post date:** [October 26, 2020, 4:24pm UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/7 "2020-10-26T16:24:08Z")

</div>

> [@Rowlan](#):
>
> 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:
> 
> 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:

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.

---

<div class="post-metadata">

**Author:** ![JoshPeterson](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/joshpeterson/32/44179_2.png) [@JoshPeterson](https://discussions.unity.com/u/JoshPeterson)\
**Post date:** [October 26, 2020, 4:34pm UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/8 "2020-10-26T16:34:05Z")

</div>

Here is a link to the bug report: [Unity Issue Tracker - Poor error message from IL2CPP on Windows Desktop with specific Visual Studio installation sequence](https://issuetracker.unity3d.com/product/unity/issues/guid/1287868/) (Note that it might not appear there for a little while, I’m not sure how long it takes to sync with our internal bug tracking tool).

---

<div class="post-metadata">

**Author:** ![Tautvydas-Zilys](https://avatars.discourse-cdn.com/v4/letter/t/4bbf92/32.png) [@Tautvydas-Zilys](https://discussions.unity.com/u/Tautvydas-Zilys)\
**Post date:** [October 27, 2020, 9:25pm UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/9 "2020-10-27T21:25:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Nefahl](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@Nefahl](https://discussions.unity.com/u/Nefahl)\
**Post date:** [September 21, 2021, 4:28pm UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/10 "2021-09-21T16:28:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tautvydas-Zilys](https://avatars.discourse-cdn.com/v4/letter/t/4bbf92/32.png) [@Tautvydas-Zilys](https://discussions.unity.com/u/Tautvydas-Zilys)\
**Post date:** [September 21, 2021, 6:57pm UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/11 "2021-09-21T18:57:20Z")

</div>

> [@Nefahl](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![Nefahl](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@Nefahl](https://discussions.unity.com/u/Nefahl)\
**Post date:** [September 22, 2021, 8:47am UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/12 "2021-09-22T08:47:29Z")

</div>

> [@Tautvydas-Zilys](#):
>
> 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.

It works now the version mismatch was causing my issue, but thanks for the notice, sounds great for VS updates in the future 🙂

---

<div class="post-metadata">

**Author:** ![longsl](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/longsl/32/580778_2.png) [@longsl](https://discussions.unity.com/u/longsl)\
**Post date:** [March 1, 2022, 1:23pm UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/13 "2022-03-01T13:23:13Z")

</div>

This problem disappeared when I installed the C++ Desktop Development Kit

---

<div class="post-metadata">

**Author:** ![alapsoni](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@alapsoni](https://discussions.unity.com/u/alapsoni)\
**Post date:** [June 19, 2023, 11:27am UTC](https://discussions.unity.com/t/il2cpp-build-problem-814267/814267/14 "2023-06-19T11:27:31Z")

</div>

> [@longsl](#):
>
> This problem disappeared when I installed the C++ Desktop Development Kit

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
