[Solved] Can't compile engine : error LNK2019: unresolved external

I’m trying to migrate from 4.19 to 4.20 (upstream\release) and the compiler keeps giving 2 unresolved external symbol errors :


Creating library I:\UE4_Source\Engine\Plugins\Runtime\Synthesis\Intermediate\Build\Win64\UE4Editor\Development\Synthesis\UE4Editor-Synthesis.suppressed.lib and object I:\UE4_Source\Engine\Plugins\Runtime\Synthesis\Intermediate\Build\Win64\UE4Editor\Development\Synthesis\UE4Editor-Synthesis.suppressed.exp
2>Module.Synthesis.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Audio::TSampleBuffer<short>::TSampleBuffer<short>(class Audio::TSampleBuffer<short> const &)" (__imp_??0?$TSampleBuffer@F@Audio@@QEAA@AEBV01@@Z) referenced in function "public: virtual struct UE4Function_Private::IFunction_OwnedObject * __cdecl UE4Function_Private::TFunction_OwnedObject<class <lambda_3c58f1f2d1fc6fb9b5b769f994f1eec8> >::CopyToEmptyStorage(struct UE4Function_Private::FFunctionStorage &)const " (?CopyToEmptyStorage@?$TFunction_OwnedObject@V<lambda_3c58f1f2d1fc6fb9b5b769f994f1eec8>@@@UE4Function_Private@@UEBAPEAUIFunction_OwnedObject@2@AEAUFFunctionStorage@2@@Z)
2>I:\UE4_Source\Engine\Plugins\Runtime\Synthesis\Binaries\Win64\UE4Editor-Synthesis.dll : fatal error LNK1120: 1 unresolved externals

Creating library I:\UE4_Source\Engine\Intermediate\Build\Win64\UE4Editor\Development\AudioMixer\UE4Editor-AudioMixer.suppressed.lib and object I:\UE4_Source\Engine\Intermediate\Build\Win64\UE4Editor\Development\AudioMixer\UE4Editor-AudioMixer.suppressed.exp
2>Module.AudioMixer.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Audio::TSampleBuffer<short>::TSampleBuffer<short>(class Audio::TSampleBuffer<short> const &)" (__imp_??0?$TSampleBuffer@F@Audio@@QEAA@AEBV01@@Z) referenced in function "public: __cdecl Audio::FGranularSynth::FGranularSynth(class Audio::FGranularSynth const &)" (??0FGranularSynth@Audio@@QEAA@AEBV01@@Z)
2>I:\UE4_Source\Engine\Binaries\Win64\UE4Editor-AudioMixer.dll : fatal error LNK1120: 1 unresolved externals

None of these modules have had any changes on my end. They are straight from epic.

I did a clean/full rebuild of the engine and still getting the same 2 errors. What am I missing here ?

I had changed the FORCEINELINE define from __forceinline to __inline to allow the compiler to decide what should and shouldn’t be inlined (to improve instruction cache usage).
It turns out changing that flag is more invovolved than changing it’s definition on one platform (windows), so when other modules find contradicting definitions, the compiler throws unresolved symbol errors.

I hope this spares someone the headaches I went through :rolleyes: