Unity3D错误提示:
Unity论坛的解决办法:
Unity 2022.1.22f1 with IL2CPP not working
IL2CPP error on Building for Windows
Workaround for building with IL2CPP with Visual Studio 2022 17.4
参考的文章
方法一:修改环境变量(我的电脑 -> 属性 -> 环境变量)
变量名: _CL_
变量值: /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS文章来源:https://www.toymoban.com/news/detail-503523.html
方法二:Unity新建脚本,复制粘贴下列代码,打包即可。文章来源地址https://www.toymoban.com/news/detail-503523.html
#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
到了这里,关于【Unity3D IL2CPP】构建失败,异常:Building Library\Bee\...failed with output: d4ga_vm6.lump.cpp的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!