Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question LINK : fatal error LNK1181: cannot open input file 'GameAssembly.lib'

Discussion in 'Windows' started by goreckibdg, Aug 31, 2023.

  1. goreckibdg

    goreckibdg

    Joined:
    Dec 21, 2016
    Posts:
    4
    Hi,
    I have an error when building an app for HoloLens 2 ARM64.
    2>LINK : fatal error LNK1181: cannot open input file 'C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\build\bin\ARM64\Release\GameAssembly.lib'

    VS 2022 17.7.3
    Unity 2021.3.8f1

    I tried to reinstall VS and I imported the configuration file from a friend who has it working. It didn't help.

    Any idea how to fix it?
    Thanks in advance.

    Full output log:
    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\Enterprise\VC\Tools\MSVC\14.37.32822\bin\HostX64\ARM64\link.exe
    7. 1>    Msvc Compiler Path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\bin\HostX64\ARM64\cl.exe
    8. 1>
    9. 1>    Output directory: C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\build\bin\ARM64\Release
    10. 1>    Cache directory: C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\build\obj\il2cppOutputProject\ARM64\Release
    11. 1>EXEC : error : Unity.IL2CPP.Building.BuilderFailedException: Lump_libil2cpp_vm.cpp
    12. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\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\Enterprise\VC\Tools\MSVC\14.37.32822\include\iterator(1469): note: see declaration of 'stdext'
    14. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(71): error C2065: 'hash_compare': undeclared identifier
    15. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(71): error C2275: 'Key': expected an expression instead of a type
    16. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(38): error C2976: 'Il2CppReaderWriterLockedHashMap': too few template arguments
    17. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(75): note: see declaration of 'Il2CppReaderWriterLockedHashMap'
    18. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\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> &'
    19. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(385): note: Reason: cannot convert from 'PointerTypeMap' to 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>'
    20. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(385): note: Conversion requires a second user-defined-conversion operator or constructor
    21. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(90): note: see declaration of 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>::TryGet'
    22. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(385): note: while trying to match the argument list '(Il2CppClass *, Il2CppClass **)'
    23. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\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> &'
    24. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(438): note: Reason: cannot convert from 'PointerTypeMap' to 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>'
    25. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(438): note: Conversion requires a second user-defined-conversion operator or constructor
    26. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(102): note: see declaration of 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>::Add'
    27. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(438): note: while trying to match the argument list '(Il2CppClass *, Il2CppClass *)'
    28. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): error C2955: 'Il2CppReaderWriterLockedHashMap': use of class template requires template argument list
    29. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(75): note: see declaration of 'Il2CppReaderWriterLockedHashMap'
    30. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\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> &'
    31. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): note: Reason: cannot convert from 'PointerTypeMap' to 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>'
    32. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): note: Conversion requires a second user-defined-conversion operator or constructor
    33. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(121): note: see declaration of 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>::UnlockedBegin'
    34. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): note: while trying to match the argument list '()'
    35. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\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> &'
    36. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): note: Reason: cannot convert from 'PointerTypeMap' to 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>'
    37. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): note: Conversion requires a second user-defined-conversion operator or constructor
    38. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\utils/Il2CppHashMap.h(127): note: see declaration of 'Il2CppReaderWriterLockedHashMap<Key,T,HashFcn,EqualKey,Alloc>::UnlockedEnd'
    39. 1>C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\vm\MetadataCache.cpp(1135): note: while trying to match the argument list '()'
    40. 1>
    41. 1>Invocation was: Executable: "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\bin\HostX64\ARM64\cl.exe"
    42. 1>Arguments: "C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\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 /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"C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp" /I"C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp" /I"C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\external\bdwgc\include" /I"C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\external\xxHash" /I"C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\external\baselib\Include" /I"C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\external\baselib\Platforms\UniversalWindows\Include" /I"C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\IL2CPP\libil2cpp\pch" /I"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\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"C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\build\obj\il2cppOutputProject\ARM64\Release\libil2cpp\EAA8E263566A76EAC03A8F4E42BA307F.obj" /Fd"C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\build\obj\il2cppOutputProject\ARM64\Release\libil2cpp\EAA8E263566A76EAC03A8F4E42BA307F.pdb"
    43. 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\Enterprise\VC\Tools\MSVC\14.37.32822\bin\HostX64\x64
    44. 1>
    45. 1>   at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
    46. 1>   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    47. 1>   at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, ReadOnlyCollection`1 matchedAssemblyMethodSourceFiles)
    48. 1>   at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, Boolean throwExceptions)
    49. 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(45,5): error MSB3073: The command ""C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\\IL2CPP\build\deploy\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=ARM64 -configuration=Release -platform=winrt -outputpath="C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\\build\bin\ARM64\Release\GameAssembly.dll" --data-folder="C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\\build\bin\ARM64\Release\\" -cachedirectory="C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\\build\obj\il2cppOutputProject\ARM64\Release\\" -generatedcppdir="C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\Il2CppOutputProject\\Source"  --baselib-directory="C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\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.
    50. 1>Done building project "Il2CppOutputProject.vcxproj" -- FAILED.
    51. 2>------ Build started: Project: VSI_apoQlar, Configuration: Release ARM64 ------
    52. 2>pch.cpp
    53. 2>App.cpp
    54. 2>Main.cpp
    55. 2>UnityGenerated.cpp
    56. 2>LINK : fatal error LNK1181: cannot open input file 'C:\Users\lgorecki\Unity_Workspace\VSI_HoloLens\VSI_HoloLens\app2\build\bin\ARM64\Release\GameAssembly.lib'
    57. 2>Done building project "VSI_apoQlar.vcxproj" -- FAILED.
    58. ========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
    59. ========== Build started at 10:43 and took 04,751 seconds ==========
    60. ========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
    61. ========== Deploy started at 10:43 and took 04,751 seconds ==========
     
    Last edited: Aug 31, 2023
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,628
  3. goreckibdg

    goreckibdg

    Joined:
    Dec 21, 2016
    Posts:
    4
    I tried building on Unity 2021.3.8f1 and 2021.3.14f1, but neither worked despite creating empty folders with cleaned library folders.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,628
    Did you get the same error on 2021.3.14f1?
     
  5. goreckibdg

    goreckibdg

    Joined:
    Dec 21, 2016
    Posts:
    4
    I tried one more time and it worked on Unity 2021.3.8f1 and VS 2019 16.11.29.
    Thank you for your help!