JetBrains / UnrealLink

Apache License 2.0
128 stars 24 forks source link

Fix link error using Clang 16.0.5 on Windows #277

Closed pmb45 closed 4 months ago

pmb45 commented 5 months ago

When using Clang on Windows with Unreal Engine, RiderLink fails to link:

[74/76] Link [x64] UnrealEditor-RiderBlueprint.dll
lld-link: error: undefined symbol: class rd::SynchronousScheduler `public: static class rd::SynchronousScheduler & __cdecl rd::SynchronousScheduler::Instance(void)'::`2'::globalSynchronousScheduler
>>> referenced by C:\Users\...\AppData\Local\Temp\UnrealLink\Pyvexys\HostProject\Plugins\RiderLink\Source\RD\src\rd_framework_cpp\src\main\task\RdCall.h:74
>>>               C:\Users\...\AppData\Local\Temp\UnrealLink\Pyvexys\HostProject\Plugins\RiderLink\Intermediate\Build\Win64\x64\UnrealEditor\Development\RiderBlueprint\Module.RiderBlueprint.cpp.obj:(public: class rd::WiredRdTask<bool, class rd::Polymorphic<bool, void>> __cdecl rd::RdCall<int, bool, class rd::Polymorphic<int, void>, class rd::Polymorphic<bool, void>>::sync(int const &, class std::chrono::duration<__int64, struct std::ratio<1, 1000>>) const)
>>> referenced by C:\Users\...\AppData\Local\Temp\UnrealLink\Pyvexys\HostProject\Plugins\RiderLink\Source\RD\src\rd_framework_cpp\src\main\task\WiredRdTaskImpl.h:65
>>>               C:\Users\...\AppData\Local\Temp\UnrealLink\Pyvexys\HostProject\Plugins\RiderLink\Intermediate\Build\Win64\x64\UnrealEditor\Development\RiderBlueprint\Module.RiderBlueprint.cpp.obj:(public: virtual class rd::IScheduler * __cdecl rd::detail::WiredRdTaskImpl<bool, class rd::Polymorphic<bool, void>>::get_wire_scheduler(void) const)

Moving the static singleton definition to the .cpp file fixes this.

DecoyRS commented 4 months ago

Hey @pmb45 PR looks good, trying to figure out how PR's work right now, because the main branch is now closed for external PR's directly and needs an internal trigger

DecoyRS commented 4 months ago

Looks like I'll need to cherry-pick your changes to a local branch and upload them manually. In short, I approve this PR and merging it. but doing it the hard way. *sigh