Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Question Errors on Visual Studio 2022 when building mixed-reality app to Hololens 2

Discussion in 'Windows' started by LucasJSR, Dec 16, 2022.

  1. LucasJSR

    LucasJSR

    Joined:
    Aug 15, 2020
    Posts:
    8
    Hello everyone,

    I'm trying to build and deploy a mixed-reality app I've developed in Unity to the MS Hololens 2, but I'm running into some errors. I'm using Unity 2021.3.13f1 and Visual Studio 2022 version 17.4.3, and I used both Microsoft's Mixed-Reality Toolkit and the Vuforia plugin to develop my app. I'm following the instructions on this webpage to deploy with Visual Studio: https://learn.microsoft.com/en-us/w...dvanced-concepts/using-visual-studio?tabs=hl2

    This is the output I'm getting on Visual Studio:

    Code (CSharp):
    1. Build started...
    2. 1>------ Build started: Project: Il2CppOutputProject, Configuration: Release ARM64 ------
    3. 1>Building GameAssembly.dll with MsvcWinRtToolChain
    4. 1>    Msvc Install Version: 17.0
    5. 1>    Msvc Install SDK Directory: C:\Program Files (x86)\Windows Kits\10
    6. 1>    Msvc Linker Path: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\ARM64\link.exe
    7. 1>    Msvc Compiler Path: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\ARM64\cl.exe
    8. 1>
    9. 1>    Output directory: D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\build\bin\ARM64\Release
    10. 1>    Cache directory: D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\build\obj\il2cppOutputProject\ARM64\Release
    11. 1>EXEC : error : Unity.IL2CPP.Building.BuilderFailedException: Lump_libil2cpp_vm.cpp
    12. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(71): error C2039: 'hash_compare': is not a member of 'stdext'
    13. 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\iterator(1426): note: see declaration of 'stdext'
    14. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(71): error C2065: 'hash_compare': undeclared identifier
    15. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(71): error C2275: 'Key': expected an expression instead of a type
    16. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(38): error C2976: 'Il2CppReaderWriterLockedHashMap': too few template arguments
    17. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(75): note: see declaration of 'Il2CppReaderWriterLockedHashMap'
    18. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(38): error C2974: 'Il2CppReaderWriterLockedHashMap': invalid template argument for 'HashFcn', type expected
    19. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(75): note: see declaration of 'Il2CppReaderWriterLockedHashMap'
    20. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(385): error C2662: 'bool Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>::TryGet(const Il2CppHashMap<Key,T,HashFcn,EqualKey,Alloc>::key_type &,T *)': cannot convert 'this' pointer from 'PointerTypeMap' to 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc> &'
    21. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(385): note: Reason: cannot convert from 'PointerTypeMap' to 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>'
    22. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(385): note: Conversion requires a second user-defined-conversion operator or constructor
    23. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(90): note: see declaration of 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>::TryGet'
    24. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(385): note: while trying to match the argument list '(Il2CppClass *, Il2CppClass **)'
    25. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(438): error C2662: 'bool Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>::Add(const Il2CppHashMap<Key,T,HashFcn,EqualKey,Alloc>::key_type &,const T &)': cannot convert 'this' pointer from 'PointerTypeMap' to 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc> &'
    26. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(438): note: Reason: cannot convert from 'PointerTypeMap' to 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>'
    27. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(438): note: Conversion requires a second user-defined-conversion operator or constructor
    28. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(102): note: see declaration of 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>::Add'
    29. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(438): note: while trying to match the argument list '(Il2CppClass *, Il2CppClass *)'
    30. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): error C2955: 'Il2CppReaderWriterLockedHashMap': use of class template requires template argument list
    31. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(75): note: see declaration of 'Il2CppReaderWriterLockedHashMap'
    32. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): error C2662: 'Il2CppHashMap<Key,T,HashFcn,EqualKey,Alloc>::iterator Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>::UnlockedBegin(void)': cannot convert 'this' pointer from 'PointerTypeMap' to 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc> &'
    33. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): note: Reason: cannot convert from 'PointerTypeMap' to 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>'
    34. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): note: Conversion requires a second user-defined-conversion operator or constructor
    35. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(121): note: see declaration of 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>::UnlockedBegin'
    36. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): note: while trying to match the argument list '()'
    37. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): error C2662: 'Il2CppHashMap<Key,T,HashFcn,EqualKey,Alloc>::iterator Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>::UnlockedEnd(void)': cannot convert 'this' pointer from 'PointerTypeMap' to 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc> &'
    38. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): note: Reason: cannot convert from 'PointerTypeMap' to 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>'
    39. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): note: Conversion requires a second user-defined-conversion operator or constructor
    40. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(127): note: see declaration of 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>::UnlockedEnd'
    41. 1>D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): note: while trying to match the argument list '()'
    42. 1>
    43. 1>Invocation was: Executable: "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\ARM64\cl.exe"
    44. 1>Arguments: "D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\Source\lumpedcpp\Lump_libil2cpp_vm.cpp" /nologo /c /bigobj /W3 /Z7 /EHs /GR- /Gy /utf-8 /wd4102 /wd4800 /wd4056 /wd4190 /wd4723 /wd4467 /wd4503 /wd4996 /wd4200 /wd4834 /wd4722 /Ox /Oi /Oy- /GS- /Gw /GF /Zo /MD -d2ssa-cfg-jt- /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 /DBASELIB_USE_DYNAMICLIBRARY=1 /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=22621 /D__WRL_NO_DEFAULT_LIB__ /DWINAPI_FAMILY=WINAPI_FAMILY_APP /I"D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp" /I"D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp" /I"D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\external\bdwgc\include" /I"D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\external\xxHash" /I"D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\external\baselib\Include" /I"D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\external\baselib\Platforms\UniversalWindows\Include" /I"D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\IL2CPP\libil2cpp\pch" /I"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\winrt" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt" /Fo"D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\build\obj\il2cppOutputProject\ARM64\Release\libil2cpp\9E146F4593830938BE83CEE75B7550DC.obj" /Fd"D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\build\obj\il2cppOutputProject\ARM64\Release\libil2cpp\9E146F4593830938BE83CEE75B7550DC.pdb"
    45. 1>EnvArg key: PATH value: C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64
    46. 1>
    47. 1>   at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
    48. 1>   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    49. 1>   at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, ReadOnlyCollection`1 matchedAssemblyMethodSourceFiles)
    50. 1>   at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, Boolean throwExceptions)
    51. 1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(45,5): error MSB3073: The command ""D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\\IL2CPP\build\deploy\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=ARM64 -configuration=Release -platform=winrt -outputpath="D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\\build\bin\ARM64\Release\GameAssembly.dll" --data-folder="D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\\build\bin\ARM64\Release\\" -cachedirectory="D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\\build\obj\il2cppOutputProject\ARM64\Release\\" -generatedcppdir="D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\Il2CppOutputProject\\Source"  --incremental-g-c-time-slice=3 --baselib-directory="C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Data\PlaybackEngines\MetroSupport\Players\UAP\il2cpp\ARM64\Release" --avoid-dynamic-library-copy --dont-deploy-baselib --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-win32 -verbose --relative-data-path=Data/il2cpp_data --compiler-flags="-d2ssa-cfg-jt-"" exited with code 4.
    52. 1>Done building project "Il2CppOutputProject.vcxproj" -- FAILED.
    53. 2>------ Build started: Project: MR Assistant, Configuration: Release ARM64 ------
    54. 2>pch.cpp
    55. 2>App.cpp
    56. 2>UnityGenerated.cpp
    57. 2>Main.cpp
    58. 2>LINK : fatal error LNK1181: cannot open input file 'D:\OneDrive\UP\DEEC\2022-23\Mixed Reality and Virtual Environments\MR Assistant\Builds\ARM64\build\bin\ARM64\Release\GameAssembly.lib'
    59. 2>Done building project "MR Assistant.vcxproj" -- FAILED.
    60. ========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
    61. ========== Elapsed 01:11,798 ==========
    62. ========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
    63. ========== Elapsed 01:11,800 ==========
    I'm not sure where the problem is, so if someone could help me out I would be really thankful!
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,159
  3. LucasJSR

    LucasJSR

    Joined:
    Aug 15, 2020
    Posts:
    8
    Thank you! Sorry for not seeing that thread before.