当前位置:   article > 正文

【Unity3D IL2CPP】构建失败,异常:Building Library\Bee\...failed with output: d4ga_vm6.lump.cpp_unity bee

unity bee

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

方法二:Unity新建脚本,复制粘贴下列代码,打包即可。

#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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/运维做开发/article/detail/805519
推荐阅读
相关标签
  

闽ICP备14008679号