我是靠谱客的博主 光亮雪碧,这篇文章主要介绍【Unity】解决IL2CPP打包报错Building xxx\ei6vj\wncp_y_vm6.lump.obj failed with output: qtky_vm6.lump.cpp,现在分享给大家,希望可以做个参考。
IL2CPP打包Windows exe时报错 Building LibraryBeeartifactsWinPlayerBuildProgramei6vjwncp_y_vm6.lump.obj failed with output: qtky_vm6.lump.cpp
是由MSVC升级导致的,可以通过升级Unity版本解决,详见:
https://forum.unity.com/threads/workaround-for-building-with-il2cpp-with-visual-studio-2022-17-4.1355570/
若不便升级Unity版本,可以将以下代码放到项目的任意脚本中临时解决问题:
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30// Adding this script to anywhere within your project. // FIX ERROR: Building LibraryBeeartifactsWinPlayerBuildProgramei6vjwncp_y_vm6.lump.obj failed with output: qtky_vm6.lump.cpp // FROM: https://forum.unity.com/threads/workaround-for-building-with-il2cpp-with-visual-studio-2022-17-4.1355570/ // SEE: https://developercommunity.visualstudio.com/t/stdext::hash_compare-has-been-removed-in/10182319 // https://issuetracker.unity3d.com/issues/il2cpp-windows-builds-fails-when-using-vs-2022-17-dot-4-0-preview #if UNITY_EDITOR using System; using UnityEditor.Build; using UnityEditor.Build.Reporting; public class MsvcStdextWorkaround : IPreprocessBuildWithReport { const string kWorkaroundFlag = "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS"; public int callbackOrder => 0; public void OnPreprocessBuild(BuildReport report) { var clEnv = Environment.GetEnvironmentVariable("_CL_"); if (string.IsNullOrEmpty(clEnv)) { Environment.SetEnvironmentVariable("_CL_", kWorkaroundFlag); } else if (!clEnv.Contains(kWorkaroundFlag)) { clEnv += " " + kWorkaroundFlag; Environment.SetEnvironmentVariable("_CL_", clEnv); } } } #endif // UNITY_EDITOR
最后
以上就是光亮雪碧最近收集整理的关于【Unity】解决IL2CPP打包报错Building xxx\ei6vj\wncp_y_vm6.lump.obj failed with output: qtky_vm6.lump.cpp的全部内容,更多相关【Unity】解决IL2CPP打包报错Building内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复