Successfully added class ‘‘,however you must recompile the ‘‘module before it will appear in the Con

本文介绍了在UnrealEngine4中创建C++工程时遇到的编译错误,涉及到.NET6.0框架缺失、模块刷新和头文件引用问题。提供了解决方案,包括刷新VisualStudio项目和修复头文件引用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

UE4系列文章目录

前言

我在unreal engine4中,创建c++工程,我在加入一个新类myCharacter,myCharacter继承自ACharacter,结果ue4编译报错:Successfully added class ‘’,however you must recompile the '‘module before it will appear in the Content Browser.Failed to automatically hot reload the’'module.Would you like to open Output log to see more details?

一、错误原因

目前没有分析出错误原因,估计是unreal engine4内部的问题,我又用unreal engine5.3创建c++工程,结果编译器又报错:
Running D:/Program Files/Epic Games/UE_5.3/Engine/Build/BatchFiles/Build.bat -projectfiles -project=“E:/UE5/ue5Exercise/myCharacterTest/myCharacterTest.uproject” -game -rocket -progress
Using bundled DotNet SDK version: 6.0.302
Running UnrealBuildTool: dotnet “…\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll” -projectfiles -project=“E:/UE5/ue5Exercise/myCharacterTest/myCharacterTest.uproject” -game -rocket -progress
Log file: C:\Users\ASUS\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…
Visual Studio 2019 does not support .NET 6.0 C# projects, these projects will not be added to the generated solution.
Please generate the Visual Studio 2022 solution if .NET 6.0 C# project support is required.
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.30138

原因:我没有装framework DotNot 6.0,无奈电脑没空间了,不想装。

二、解决方法

重新编译项目:在UE4编辑器中,点击菜单栏中的“File(文件)” -> “Refresh Visual Studio Project(刷新Visual Studio项目)”。然后在Visual Studio中重新编译整个项目。或者如果你使用的是其他编译器,确保对项目进行重新编译。
在这里插入图片描述

在这里插入图片描述
结果编译器又报错:
严重性 代码 说明 项目 文件 行 禁止显示状态
错误(活动) E0020 未定义标识符 “PrimaryActorTick” CharacterTest E:\UE4\ue4Exercise\CharacterTest\Source\CharacterTest\myPlayers\mainPlayerTest.cpp 10
严重性 代码 说明 项目 文件 行 禁止显示状态
错误 C1083 无法打开包括文件: “myPlayers/mainPlayerTest.h”: No such file or directory CharacterTest E:\UE4\ue4Exercise\CharacterTest\Source\CharacterTest\myPlayers\mainPlayerTest.cpp 4
严重性 代码 说明 项目 文件 行 禁止显示状态
错误(活动) E1696 无法打开 源 文件 “myPlayers/mainPlayerTest.h” CharacterTest E:\UE4\ue4Exercise\CharacterTest\Source\CharacterTest\myPlayers\mainPlayerTest.cpp 4

在这里插入图片描述
解决办法:
编译器在自动生成代码是包含头文件出错,所以改一下头文件即可:把
#include “myPlayers/mainPlayerTest.h” 修改成
#include “mainPlayerTest.h”
在这里插入图片描述
在这里插入图片描述

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值