【发布时间】:2022-06-15 13:10:26
【问题描述】:
我正在尝试编译我正在处理的项目,但弹出以下错误消息:
Invalidating makefile for SpaceShooterEditor (SpaceShooter.Build.cs modified)
While compiling E:\ue projects\SpaceShooter\Intermediate\Build\BuildRules\SpaceShooterModuleRules.dll:
e:\ue projects\SpaceShooter\Source\SpaceShooter\SpaceShooter.Build.cs(3,29) : error CS0246: The type or namespace name 'ModuleRules' could not be found (are you missing a using directive or an assembly reference?)
e:\ue projects\SpaceShooter\Source\SpaceShooter\SpaceShooter.Build.cs(5,25) : error CS0246: The type or namespace name 'ReadOnlyTargetRules' could not be found (are you missing a using directive or an assembly reference?)
ERROR: Unable to compile source files.
知道为什么会发生这种情况吗?昨晚我试图编写一个小部件,修改了 build.cs,然后用以前工作的 build.cs 替换了修改后的版本(它破坏了游戏),但仍然没有?有没有希望让它发挥作用,还是我应该重新开始?还有,如何避免呢?
我已经进行了重新启动和刷新。我什至去删除了二进制文件和一些已兑现的文件,但没有用。
您将在下面找到 Build.cs 的内容:
public class SpaceShooter : ModuleRules
{
public SpaceShooter(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string[] { });
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
// Uncomment if you are using online features
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
}
}
当我尝试输入指定 using UnrealBuildTool; 时,Visual Studio 出于某种原因,在我点击编译或保存时将其删除。
【问题讨论】:
-
用以前的版本替换文件时是否出现不同的错误?
-
不幸的是,没有。同样的错误。我会尽快发布上述构建文件的内容。
标签: c# unreal-engine4