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打开虚幻工程,并重生成工程即可;

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

最近更新

  1. TCP协议是安全的吗?

    2024-02-01 00:00:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-02-01 00:00:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-02-01 00:00:02       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-02-01 00:00:02       20 阅读

热门阅读

  1. Liunx shell编程及自动化运维实现--第三章循环

    2024-02-01 00:00:02       35 阅读
  2. 【InternLM 大模型实战】作业与笔记汇总

    2024-02-01 00:00:02       38 阅读
  3. DAY36: 贪心算法part5区间问题435、763、56

    2024-02-01 00:00:02       39 阅读
  4. Mysql-锁

    Mysql-锁

    2024-02-01 00:00:02      30 阅读
  5. Android是如何识别USB信号的

    2024-02-01 00:00:02       33 阅读
  6. 小白Linux学习笔记-2.Linux用户和组

    2024-02-01 00:00:02       29 阅读
  7. vue3 slot的定义与使用

    2024-02-01 00:00:02       26 阅读