Skip to content

Cannot build any MRTK example with VS 2022 for ARM #10647

@dl4mmers

Description

@dl4mmers

Describe the issue

Hi! On my old PC I have VS 2017 installed and can build my HL application (Unity 2019.4.39f1 / Legacy XR) for Release / Master / x86 / ARM.

Now I have to setup a new PC for HoloLens developing and installed all the tools as listed here: https://docs.microsoft.com/en-us/windows/mixed-reality/develop/install-the-tools

When trying to build the existing application for ARM with VS 2022 I get compiler errors and so I created a new project with MRTK 2.8.0 / OpenXR / Unity 2020.3.35f1 and tried to build one of the MRTK example scenes: Same compiler error.

EXEC : error : Unity.IL2CPP.Building.BuilderFailedException: mscorlib2.cpp
1>C:\Users\xxxxx\MRTK_Test\App\Il2CppOutputProject\Source\il2cppOutput\mscorlib2.cpp(23662): fatal error C1001: Interner Compilerfehler.
1>(Compilerdatei "D:\a\_work\1\s\src\vctools\Compiler\Utc\src\p2\main.c", Zeile 220)
1> Um dieses Problem zu umgehen, vereinfachen oder �ndern Sie das Programm im Umfeld der oben aufgef�hrten Positionen.
1>Geben Sie nach M�glichkeit hier Reproduktionsschritte an: https://developercommunity.visualstudio.com
1>W�hlen Sie im Men� "Hilfe" von Visual C++ den Befehl "Technischer Support",
1> oder �ffnen Sie die Hilfedatei des technischen Supports, um weitere Informationen zu erhalten.
1>
1>Invocation was: Executable: "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\HostX64\ARM\cl.exe"
1>Arguments: "C:\Users\xxxxx\MRTK_Test\App\Il2CppOutputProject\Source\il2cppOutput\mscorlib2.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"C:\Users\xxxxx\MRTK_Test\App\build\obj\il2cppOutputProject\ARM\Release\ABC3A73165AD83A75203E2694DF0F1AF.pch" /MD /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 /DIL2CPP_DEFAULT_DATA_DIR_PATH=Data/il2cpp_data /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 /D__arm__ /DWINDOWS_SDK_BUILD_VERSION=19041 /D__WRL_NO_DEFAULT_LIB__ /DWINAPI_FAMILY=WINAPI_FAMILY_APP /I"C:\Users\xxxxx\MRTK_Test\App\Il2CppOutputProject\IL2CPP\libil2cpp" /I"C:\Users\xxxxx\MRTK_Test\App\Il2CppOutputProject\IL2CPP\libil2cpp" /I"C:\Users\xxxxx\MRTK_Test\App\Il2CppOutputProject\IL2CPP\external\bdwgc\include" /I"C:\Users\xxxxx\MRTK_Test\App\Il2CppOutputProject\IL2CPP\external\xxHash" /I"C:\Users\xxxxx\MRTK_Test\App\Il2CppOutputProject\IL2CPP\external\baselib\Include" /I"C:\Users\xxxxx\MRTK_Test\App\Il2CppOutputProject\IL2CPP\external\baselib\Platforms\UniversalWindows\Include" /I"C:\Users\xxxxx\MRTK_Test\App\Il2CppOutputProject\IL2CPP\libil2cpp\pch" /I"C:\Users\xxxxx\MRTK_Test\App\Il2CppOutputProject\Source" /I"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\include" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt" /Fo"C:\Users\xxxxx\MRTK_Test\App\build\obj\il2cppOutputProject\ARM\Release\D7642EB35C1402E254D1D71C0334BDAD.obj" /Fd"C:\Users\xxxxx\MRTK_Test\App\build\obj\il2cppOutputProject\ARM\Release\D7642EB35C1402E254D1D71C0334BDAD.pdb"
1>EnvArg key: PATH value: C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\HostX64\x64
1>
1>   at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
1>   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
1>   at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions, ReadOnlyCollection`1 matchedAssemblyMethodSourceFiles)
1>   at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions, Boolean throwExceptions)
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(45,5): error MSB3073: Der Befehl ""C:\Users\xxxxx\MRTK_Test\App\Il2CppOutputProject\\IL2CPP\build\deploy\netcoreapp3.1\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=ARMv7 -configuration=Release -platform=winrt -outputpath="C:\Users\xxxxx\MRTK_Test\App\\build\bin\ARM\Release\GameAssembly.dll" --data-folder="C:\Users\xxxxx\MRTK_Test\App\\build\bin\ARM\Release\\" -cachedirectory="C:\Users\xxxxx\MRTK_Test\App\\build\obj\il2cppOutputProject\ARM\Release\\" -generatedcppdir="C:\Users\xxxxx\MRTK_Test\App\Il2CppOutputProject\\Source"  --incremental-g-c-time-slice=3 --baselib-directory="C:\Program Files\Unity\Hub\Editor\2020.3.35f1\Editor\Data\PlaybackEngines\MetroSupport\Players\UAP\il2cpp\ARM\Release" --avoid-dynamic-library-copy --profiler-report --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityaot -verbose --relative-data-path=Data/il2cpp_data --map-file-parser="C:\Users\xxxxx\MRTK_Test\App\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" wurde mit dem Code 4 beendet.
1>Die Erstellung des Projekts "Il2CppOutputProject.vcxproj" ist abgeschlossen -- FEHLER.

x86 and ARM64 working fine, but because I'm using MixedReality-WebRTC in my application, i cannot build for ARM64. Is this a known issue?

As stated in the documentation I've installed VS 2022 package "C++ (v142) Universal Windows Platform tools (required when using Unity)" but it seems that for the build v143 is used (and also listed in the vxproj files). I tried to set this to v142 in the vxproj files, but then get this error:

1>il2cpp.exe didn't catch exception: System.NotSupportedException: Visual Studio 2017 support for ARMv7 is not installed.
1>   bei Unity.IL2CPP.Building.ToolChains.MsvcVersions.Msvc15InstallationBase.ThrowIfArchitectureNotInstalled(Architecture architecture)
1>   bei Unity.IL2CPP.Building.ToolChains.MsvcVersions.Msvc15InstallationBase.<GetSdkIncludeDirectories>d__20.MoveNext()
1>   bei Unity.IL2CPP.Building.ToolChains.MsvcVersions.MsvcInstallation.IsWindowsSDKInstalled(Architecture architecture)
1>   bei Unity.IL2CPP.Building.ToolChains.MsvcVersions.MsvcInstallation.GetReasonCannotBuildCode(Architecture architecture)
1>   bei Unity.IL2CPP.Building.ToolChains.MsvcVersions.MsvcInstallation.GetReasonMsvcInstallationCannotBuild(Architecture architecture)
1>   bei Unity.IL2CPP.Building.ToolChains.MsvcVersions.MsvcInstallation.GetReasonMsvcInstallationCannotBuild(Version version, Architecture architecture)
1>   bei Unity.IL2CPP.Building.ToolChains.MsvcVersions.MsvcInstallation.GetMsvcVersionRequirementsForBuildingAndReasonItCannotBuild(Version version, Architecture architecture)
1>   bei Unity.IL2CPP.Building.ToolChains.MsvcWinRtToolChain.GetCannotBuildInCurrentEnvironmentErrorMessage()
1>   bei Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment()
1>   bei Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
1>   bei il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
1>   bei il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
1>   bei il2cpp.Program.Main(String[] args)

Or when removing all of C++ (v143) packages I get:

1>il2cpp.exe didn't catch exception: System.InvalidOperationException: C++ code builder is unable to build C++ code. In order to build C++ code for Universal Windows Platform, you must have one of these installed:
1>        Visual Studio 2015 with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed or missing C++ workload component)
1>        Visual Studio 2015 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\14.0_Config\InstallDir" in the registry
1>        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
1>
1>        Visual Studio 2017 (or newer) with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed or missing C++ workload component)
1>        Visual Studio 2017 (or newer) installation is found using Microsoft.VisualStudio.Setup.Configuration COM APIs
1>        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry

I think an older compiler (used in VS 2017 or VS 2019) should work for ARM when build is started from VS 2022, but I could not find out how this can be configured.

Feature area

VS 2022 should be able to build HoloLens applications for all supported platforms, but ARM does not work. After building a MRTK example scene in Unity, VS 2022 is showing up a notification that package "C++ (v143) Universal Windows Platform tools" should be installed to be able to build the application, while this package is not listed in the documentation. The vxproj files in Unity output folder do contain references to v143 build tools. When changing these references to v142 build tools, VS 2022 is showing an error when trying to build the app "Visual Studio 2017 support for ARMv7 is not installed" although v142 build tools are installed as suggested in docs.

Existing doc link

https://docs.microsoft.com/en-us/windows/mixed-reality/develop/install-the-tools

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationExternalThis is an issue with, or behavior of a component / tool external to MRTKMRTK2Won't FixA real bug, but Triage feels that the issue is not impactful enough to spend time on

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions