我是靠谱客的博主 光亮雪碧,最近开发中收集的这篇文章主要介绍【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版本,可以将以下代码放到项目的任意脚本中临时解决问题:

// 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 xxx\ei6vj\wncp_y_vm6.lump.obj failed with output: qtky_vm6.lump.cpp所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(46)

评论列表共有 0 条评论

立即
投稿
返回
顶部