首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用visual studio 2019访问unreal engine 4.25中的头文件

无法使用visual studio 2019访问unreal engine 4.25中的头文件
EN

Stack Overflow用户
提问于 2020-09-01 15:21:03
回答 1查看 1.2K关注 0票数 0

大家好,感谢你们检查我的问题,

我正在学习UE4.25和c++的虚幻引擎的教程。我目前被代码的静态网格部分卡住了。由于某些原因,我似乎无法访问所需的头文件,不仅是组件,而且是像Engine这样的任何主要文件夹。

当我输入#include“”时,只有松散的头文件弹出,没有一个是我需要的(图片不会发布,所以我会发布相关的代码)。

这是.h文件中的内容:

#杂注一次

#include "CoreMinimal.h“#include "GameFramework/Actor.h”#include "Bullet.generated.h“

代码语言:javascript
复制
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

代码语言:javascript
复制
#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");
    
}
EN

回答 1

Stack Overflow用户

发布于 2020-09-01 23:19:28

这听起来像是Visual Studio中的intellisense问题。vanilla Visual Studio需要很长时间来解析UE,我个人刚刚将其关闭,转而使用Visual Assist X

您可以只使用#include "Components/StaticMeshComponent.h",它应该可以很好地编译。Classifier是一个很好的免费资源,可以帮助你找到所需的包含路径,并且对开始使用虚幻非常有帮助。

另一种选择是尝试Rider for Unreal而不是Visual Studio,根据我所看到的,Visual Studio为UE提供了更好的智能感知/代码助手。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63683096

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档