focus-creative-games / hybridclr_trial

HybridCLR 示例项目
https://code-philosophy.com/
829 stars 172 forks source link

Exception: Unity.IL2CPP.Building.BuilderFailedException: il2cpp-api.cpp #2

Closed zuig closed 2 years ago

zuig commented 2 years ago

Exception: Unity.IL2CPP.Building.BuilderFailedException: il2cpp-api.cpp D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(22): error C2653: ��GOOGLE_NAMESPACE��: ������������ռ����� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(66): note: �鿴�����ڱ���� �� ģ�� ʵ������Il2CppHashMap<Key,T,HashFcn,EqualKey,Alloc>�������� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(29): error C2653: ��GOOGLE_NAMESPACE��: ������������ռ����� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(18): error C2653: ��GOOGLE_NAMESPACE��: ������������ռ����� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(18): error C2065: ��libc_allocator_with_realloc��: δ�����ı�ʶ�� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(18): error C2275: ��std::pair<const KeyWrapper,T>��: ����������������ʽ�Ƿ� with [ Key=const char , T=Il2CppClass ] D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(18): note: �μ���std::pair<const KeyWrapper,T>�������� with [ Key=const char , T=Il2CppClass ] D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\vm/MetadataCache.h(35): error C2976: ��Il2CppHashMap��: ģ�� ����̫�� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(22): note: �μ���Il2CppHashMap�������� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\vm/MetadataCache.h(35): error C2974: 'Il2CppHashMap' : ģ�� ���� 'Alloc'����Ч������ӦΪ���� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(22): note: �μ���Il2CppHashMap�������� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(18): error C2275: ��std::pair<const KeyWrapper,T>��: ����������������ʽ�Ƿ� with [ Key=const Il2CppClass , T=const char ] D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(18): note: �μ���std::pair<const KeyWrapper,T>�������� with [ Key=const Il2CppClass , T=const char ] D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\vm/MetadataCache.h(36): error C2976: ��Il2CppHashMap��: ģ�� ����̫�� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(22): note: �μ���Il2CppHashMap�������� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\vm/MetadataCache.h(36): error C2974: 'Il2CppHashMap' : ģ�� ���� 'Alloc'����Ч������ӦΪ���� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(22): note: �μ���Il2CppHashMap�������� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(18): error C2275: ��std::pair<const KeyWrapper,T>��: ����������������ʽ�Ƿ� with [ Key=il2cpp::metadata::Il2CppSignature, T=Il2CppMethodPointer ] D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(18): note: �μ���std::pair<const KeyWrapper,T>�������� with [ Key=il2cpp::metadata::Il2CppSignature, T=Il2CppMethodPointer ] D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\vm/MetadataCache.h(37): error C2976: ��Il2CppHashMap��: ģ�� ����̫�� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(22): note: �μ���Il2CppHashMap�������� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\vm/MetadataCache.h(37): error C2974: 'Il2CppHashMap' : ģ�� ���� 'Alloc'����Ч������ӦΪ���� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(22): note: �μ���Il2CppHashMap�������� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(18): error C2275: ��std::pair<const KeyWrapper,T>��: ����������������ʽ�Ƿ� with [ Key=const Il2CppGenericMethod , T=const Il2CppGenericMethodIndices ] D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(18): note: �μ���std::pair<const KeyWrapper,T>�������� with [ Key=const Il2CppGenericMethod , T=const Il2CppGenericMethodIndices ] D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\vm/MetadataCache.h(38): error C2976: ��Il2CppHashMap��: ģ�� ����̫�� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(22): note: �μ���Il2CppHashMap�������� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\vm/MetadataCache.h(38): error C2974: 'Il2CppHashMap' : ģ�� ���� 'Alloc'����Ч������ӦΪ���� D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\utils/Il2CppHashMap.h(22): note: �μ���Il2CppHashMap��������

Invocation was: Executable: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe" Arguments: "D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\il2cpp-api.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 /MT /DNET_4_0 /DUNITY_AOT /DIL2CPP_MONO_DEBUGGER_DISABLED /DGC_NOT_DLL /DRUNTIME_IL2CPP /DBASELIB_INLINE_NAMESPACE=il2cpp_baselib /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=17763 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP /I"D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp" /I"D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp" /I"D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\external\bdwgc\include" /I"D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\external\xxHash" /I"D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\external\baselib\Include" /I"D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\external\baselib\Platforms\Windows\Include" /I"D:\Github\Framework\hybridclr_trial\HybridCLRData\LocalIl2CppData\il2cpp\libil2cpp\pch" /I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt" /Fo"D:\Github\Framework\hybridclr_trial\Library\il2cpp_cache\libil2cpp\929CB01B6378F8D1173BD9749DD3A5B1.obj" /Fd"D:\Github\Framework\hybridclr_trial\Library\il2cpp_cache\libil2cpp\929CB01B6378F8D1173BD9749DD3A5B1.pdb" EnvArg key: PATH value: C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64

at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector) at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics) at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions, ReadOnlyCollection1 matchedAssemblyMethodSourceFiles) at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions, Boolean throwExceptions) UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <969aeaba2c2a443599af04f6dca31e79>:0) UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1[T] setupStartInfo) (at <969aeaba2c2a443599af04f6dca31e79>:0) UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List1[T] arguments, System.Action1[T] setupStartInfo) (at <969aeaba2c2a443599af04f6dca31e79>:0) UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data) (at <969aeaba2c2a443599af04f6dca31e79>:0) UnityEditorInternal.IL2CPPBuilder.Run () (at <969aeaba2c2a443599af04f6dca31e79>:0) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <969aeaba2c2a443599af04f6dca31e79>:0) DesktopStandalonePostProcessor.RunIL2CPP (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, System.Collections.Generic.List1[T] cppPlugins) (at <969aeaba2c2a443599af04f6dca31e79>:0) DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet1[T] filesToNotOverwrite) (at <969aeaba2c2a443599af04f6dca31e79>:0) DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <969aeaba2c2a443599af04f6dca31e79>:0) Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown. DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <969aeaba2c2a443599af04f6dca31e79>:0) UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <969aeaba2c2a443599af04f6dca31e79>:0) UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <969aeaba2c2a443599af04f6dca31e79>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

zuig commented 2 years ago

应该是Unity 2020.3.16f1版本问题,换一个Unity版本就正常了

pirunxi commented 2 years ago

妥。这是新手容易犯的问题。解决就好。