PreyK / Unreal-Minimum-Viable-Flecs

Minimum viable Flecs entity component system implementation in Unreal Engine.
151 stars 13 forks source link

Issues replicating same setup on newer version of Unreal (5.3) with fresh project #6

Closed VergilUa closed 1 year ago

VergilUa commented 1 year ago

Hi, I've got some issues related to the replicating same setup with newer version of Unreal and Flecs lib from repo (v.3.2.7). By default newer projects are generated with these build target rules: DefaultBuildSettings = BuildSettingsVersion.V4; IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_3;

While example has V2 build settings version. This introduces some errors which can be fixed. But my biggest problem is linking issues produced by Flecs lib. I've set it to dynamic by commenting define @ flecs.h. And, as soon as I add flecs.h to the subsystem I get ton of linking errors, like:

FlecsSubsystem.cpp.obj : error LNK2019: unresolved external symbol imp_EcsDocBrief referenced in function "void cdecl flecs::doc::`dynamic initializer for 'Brief''(void)" (??EBrief@doc@flecs@@YAXXZ) FlecsSubsystem.gen.cpp.obj : error LNK2001: unresolved external symbol __imp_EcsDocBrief FlecsSubsystem.cpp.obj : error LNK2019: unresolved external symbol imp_EcsDocDetail referenced in function "void cdecl flecs::doc::`dynamic initializer for 'Detail''(void)" (??EDetail@doc@flecs@@YAXXZ) FlecsSubsystem.gen.cpp.obj : error LNK2001: unresolved external symbol imp_EcsDocDetail FlecsSubsystem.cpp.obj : error LNK2019: unresolved external symbol __imp_EcsDocLink referenced in function "void cdecl flecs::doc::dynamic initializer for 'Link''(void)" (??__ELink@doc@flecs@@YAXXZ) FlecsSubsystem.gen.cpp.obj : error LNK2001: unresolved external symbol __imp_EcsDocLink FlecsSubsystem.cpp.obj : error LNK2019: unresolved external symbol __imp_EcsDocColor referenced in function "void __cdecl flecs::doc::dynamic initializer for 'Color''(void)" (??EColor@doc@flecs@@YAXXZ) FlecsSubsystem.gen.cpp.obj : error LNK2001: unresolved external symbol imp_EcsDocColor FlecsSubsystem.cpp.obj : error LNK2019: unresolved external symbol imp_EcsConstant referenced in function "void cdecl flecs::`dynamic initializer for 'Constant''(void)" (??EConstant@flecs@@YAXXZ) FlecsSubsystem.gen.cpp.obj : error LNK2001: unresolved external symbol __imp_EcsConstant FlecsSubsystem.cpp.obj : error LNK2019: unresolved external symbol imp_EcsQuantity referenced in function "void cdecl flecs::`dynamic initializer for 'Quantity''(void)" (??EQuantity@flecs@@YAXXZ) FlecsSubsystem.gen.cpp.obj : error LNK2001: unresolved external symbol __imp_EcsQuantity

Example works with build errors fixed, so that means I'm missing something obvious. If you have any idea - please let me know, thanks.

VergilUa commented 1 year ago

Didn't realized that Unreal modules cannot be modified freely while editor running. Also, had a couple of issues in Build.cs and with fixing those its more or less works.

If anyone encounters similar issues - follow Unreal's guide on making modules https://docs.unrealengine.com/5.3/en-US/unreal-engine-modules/