Sixze / ALS-Refactored

Completely reworked and improved C++ version of Advanced Locomotion System V4.
MIT License
943 stars 261 forks source link

Linux Compilation Issues #475

Closed josephjaspers closed 1 month ago

josephjaspers commented 5 months ago

Reopening: https://github.com/Sixze/ALS-Refactored/issues/468

Clangs C++20 and MSVC C++20 support differ.

1) Bitfield class init isn't supported yet in Clang.

        uint8 bStateValid : 1 {false};

Error:

<Project>/Plugins/ALS-Refactored/Source/ALS/Public/Utility/AlsMath.h:35:24: error: default member initializer for bit-field is a C++20 extension [-Werror,-Wc++20-extensions]

2) ALS.Build.cs needs CppStandard = CppStandardVersion.Cpp20 for Clang to use C++20. (Regardless, this doesn't fix the other missing features).

3) Requires isn't supported yet. (Tragically)

requires std::is_floating_point_v<ValueType>

error:

Plugins/ALS-Refactored/Source/ALS/Public/Utility/AlsMath.h:102:76: error: expected ';' at end of declaration list
        template <typename ValueType> requires std::is_floating_point_v<ValueType>
  1. ALSEditor.Build.cs is missing "AnimGraphRuntime" as a module dependency Error:
    ld.lld: error: undefined symbol: vtable for FAnimNode_BlendListBase
    >>> referenced by AnimNode_BlendListBase.h:24 (Runtime/AnimGraphRuntime/Public/AnimNodes/AnimNode_BlendListBase.h:24)
    >>>               /home/joseph/Documents/Unreal Projects/Bells/Plugins/ALS-Refactored/Intermediate/Build/Linux/x64/UnrealEditor/Development/ALSEditor/Module.ALSEditor.cpp.o:(FAlsAnimNode_GameplayTagsBlend::~FAlsAnimNode_GameplayTagsBlend())
    >>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
    clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Sixze commented 5 months ago

This is weird. C++20 is the default in UE 5.3, and I don't have all these issues on my machine. Check the version of Clang on your machine, UE 5.3 requires 16.0.6.

josephjaspers commented 5 months ago

Epic bundles their version of Clang with UE~~ maybe they just need to upgrade to a newer version? I'll check it out~~

watsonsong commented 5 months ago

I met the same issue No.4. And I add "AnimGraphRuntime" to ALSEditor.Build.cs resolve it. When I build dedicated server on linux.