【发布时间】:2020-12-20 07:09:57
【问题描述】:
大家好,感谢您查看我的问题,
我正在学习使用 UE 4.25 和 c++ 学习虚幻引擎的教程。我目前停留在代码的静态网格部分。出于某种原因,我似乎无法访问所需的头文件,不仅是组件,还包括引擎等任何主要文件夹。
当我输入#include“”时,只弹出松散的头文件,没有一个是我需要的(图片不会发布,所以我会发布相关代码)。
这是来自 .h 文件:
#pragma 一次
#include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "Bullet.generated.h"
UCLASS()
class MYPROJECT_API ABullet : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
ABullet();
UPROPERTY(EditAnywhere, Category = "Components")
class UStaticMeshComponent* BulletMesh;
}
这是来自 .cpp
#include "Bullet.h"
//Components/StaticMeshComponent.h should go here but it doesn't show with the #include for some reason
// Sets default values
ABullet::ABullet()
{
// 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;
BulletMesh = CreateDefaultSubobject<UStaticMeshComponent>("BulletMesh");
}
【问题讨论】:
-
这是智能感知问题还是编译时也找不到包含文件?
-
“CoreMinimal.h”和“GameFramework/Actor.h”等自动生成的完全没有问题
标签: c++ visual-studio-2019 unreal-engine4