在生成Actor(虚幻引擎4)时出现错误
Plethora of errors upon generating an Actor (Unreal Engine 4)
前几天刚开始进入虚幻引擎,但当我试图从编辑器中创建一个新的actor时,我在Visual Studio中立即出现了错误。
我根本没有更改任何代码,但我收到了87个错误。
这是一些错误的图片。
我已经在下面发布了我的两个演员档案,并可以在任何有错误下划线的行旁边发表评论。这是我对代码所做的唯一更改。
这是我的"MyActor.h"文件。
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "MyActor.generated.h" //Red underline under '#include'
UCLASS() //Green underline under 'UCLASS'
class BIGFEET_API AMyActor : public AActor
{
GENERATED_BODY() //Red underline under 'GENERATED_BODY'
public:
// Sets default values for this actor's properties
AMyActor();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
};
这是我的"MyActor.ccp"文件。
// Fill out your copyright notice in the Description page of Project Settings.
#include "MyActor.h"
// Sets default values
AMyActor::AMyActor()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void AMyActor::BeginPlay()
{
Super::BeginPlay(); //Red underline under 'BeginPlay'
}
// Called every frame
void AMyActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime); //Red underline under 'Tick'
}
我想这是发动机的某种设置问题,在做了一些研究后,我一直不知道该怎么办。如果有任何帮助,我将不胜感激!
大多数错误在其他帖子中都有具体的答案,但要关注"过多"问题:
- 不要惊慌
- 选择一种类型的错误首先进行排序。当你遇到很多错误时,他们往往会成群结队地搜寻
- 对错误进行优先级排序。例如,如果它以"找不到文件"开头,您可能会得到许多相关的错误,比如blah是未定义的。修复include目录或忘记的include等可能会消除其他几个错误
- 有些错误是由打字错误或缺少分号引起的。仔细阅读错误并查看正在调用的行。你可能发现了一些东西,或者意识到前一行缺少分号或大括号,或者其他会导致后续一连串问题的东西
- 如果你收到了intelligense或警告,也要阅读。这可能会让你对根本问题有另一种看法
- 不要惊慌。我已经说过了,但一次挑一个,但还是优先考虑
- 定期编译小的更改,而不是花几个小时写代码,然后一次解决所有问题。这不好玩
相关文章:
- 当使用带有VS2019或VSCode的虚幻引擎4.24.2时,我如何修复这些错误的Intellisense错误
- Agora.io 虚幻引擎插件构建错误
- 组件上的虚幻引擎可蓝图UFUNCTION会导致构建错误
- 使用Visual Studio在虚幻引擎中创建一个新的类c ++给了我太多的错误
- 虚幻引擎C++生成演员错误
- 在虚幻引擎C++中浮点时出现TArray错误
- 在生成Actor(虚幻引擎4)时出现错误
- 我的游戏引擎的 spdlog 日志记录出现奇怪的"unresolved external symbol"错误
- 错误:使用 tesseract 引擎时 C++ 中的声明'typedef struct tagBLOB BLOB'冲突
- 游戏引擎 SFML C++错误
- 在UE4(虚幻引擎4)中集成LuaJit时LNK2005错误
- 有关 Javascript 引擎错误的问题
- 我正在尝试安装游戏引擎,但遇到错误
- 在虚幻引擎中引用外部库时出现运行时错误
- 虚幻引擎4:UShape组件给出错误"标识符未定义"。我能做什么?
- 错误太多,智能感知引擎无法正常运行
- 在 Win10 上编译 V8 引擎时LNK1181错误
- 当我尝试在启用推理引擎的情况下编译 OpenCv 时,出现错误
- 虚幻引擎 4.18.0,VS2017,不允许指向不完整类类型的错误指针
- 虚幻引擎4致命错误C1083