UE4_C++莫名其妙的错误
<blockquote>1>Module.SlAiCourse.gen.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class UClass * __cdecl Z_Construct_UClass_UWidgetComponent_NoRegister(void)" (__imp_?Z_Construct_UClass_UWidgetComponent_NoRegister@@YAPEAVUClass@@XZ) referenced in function "class UClass * __cdecl Z_Construct_UClass_ASlAiEnemyCharacter(void)" (?Z_Construct_UClass_ASlAiEnemyCharacter@@YAPEAVUClass@@XZ)引擎用的是UE4.19VS2017
这是到底什么错误啊,难道UWidgetComponent在继承自ACharacter的类不能用吗?
我自己新建了一个工程,自带ThirdPersionCharacter类,然后我在.h文件中加入了
protected:
//血条
UPROPERTY(EditAnywhere, Category = Mesh)
class UWidgetComponent* HealthUICompo;
报了同样的错误,是不是UWidgetComponent类在无法在ACharacter中引用啊 https://wiki.unrealengine.com/UMG,_Referencing_UMG_Widgets_in_Code
你是不是忘了官方文档中的第一步
1. Adding Modules:
in order to use UMG in C++ you need to Add the following Modules in ProjectNameBuild.CS file
"UMG", "Slate", "SlateCore
In this line:
//ProjectNameBuild.CS
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG", "Slate", "SlateCore" });
rrfetch 发表于 2019-10-4 10:40
https://wiki.unrealengine.com/UMG,_Referencing_UMG_Widgets_in_Code
你是不是忘了官方文档中的第一步
1. ...
谢谢,是的,重要的事情给完全忘记了 重要的事情给完全忘记了 谢谢大佬
页:
[1]