UE4初学者C++代码在VS中代码标红

UE4初学者教程:https://docs.unrealengine.com/zh-CN/Programming/QuickStart/index.html

问题:

FloatingActor.cpp文件各种标红但是能编译通过,说白了就是没有代码提示。

解决办法:

在`#include "FloatingActor.generated.h"`之前添加头文件(否则会编译失败):

#include "Components/StaticMeshComponent.h"
#include "UObject/ConstructorHelpers.h"

参考:

1. https://docs.unrealengine.com/en-US/API/Runtime/Engine/Components/UStaticMeshComponent/index.html

2. https://docs.unrealengine.com/en-US/API/Runtime/CoreUObject/UObject/ConstructorHelpers/index.html

3. 亲自实测,UE4.24.1+VS2017_15.9.18

发布了15 篇原创文章 · 获赞 1 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/plgkm6/article/details/103920779