UE5在VisualStudio升级后产生C++无法编译的问题

往期的虚幻引擎项目在VS更新后,编译时会报错,这一般出现在VS升级之后,UE对于VC++的编译器定位没有更新导致;

有出现如下问题:

问题1:

Running I:/EPCI/Epic Games/UE_5.3/Engine/Build/BatchFiles/Build.bat -projectfiles -project=“I:/GAME/PJ/我的项目2/我的项目2.uproject” -game -rocket -progress
Using bundled DotNet SDK version: 6.0.302
Running UnrealBuildTool: dotnet “…..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll” -projectfiles -project=“I:/GAME/PJ/???2/???2.uproject” -game -rocket -progress
Log file: C:\Users\Fox\AppData\Local\UnrealBuildTool\Log_GPF.txt

Some Platforms were skipped due to invalid SDK setup: IOS, Android, Linux, LinuxArm64.
See the log file for detailed information

Generating VisualStudio project files:
Discovering modules, targets and source code for project…
Microsoft platform targets must be compiled with Visual Studio 2022 17.4 (MSVC 14.34.x) or later for the installed engine. Please update Visual Studio 2022 and ensure no configuration is forcing WindowsTargetRules.Compiler to VisualStudio2019. The current compiler version was detected as: 14.29.30152

问题1解决方案:

打开VS安装器,修改,内部模组,把旧有的MSVC全部取消;

MSVC v142 - VS2019 C++ x64/x86 package
MSVC v141 - VS2017 C++ x64/x86 package
MSVC v140 - VS2015 C++ x64/x86 package
After uncheck the options, create UE5.3 C++ project again.

20231222-103022

问题2:

编译后报错

LNK1104 cannot open file 'legacy_stdio_definitions.lib'

问题2解决方案:

这个文件其实依然是由于UE定位在旧MSVC的目录导致的无法寻找到,此时将UE Editor关闭,然后直接VS打开虚幻工程的sln方案文件,并重生成游戏工程即可;

再次打开UE5,其编译也就正常了;

  • 7
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值