Hello guys!
I have implemented a class derived from UUserWidget, and I'm stuck in the following error:
https://imgur.com/a/4o3sFbU
And here is the output:
I think that, for some reason, when creating the .OBJ, the linker isn't finding the implementation for the FReply::Handled() and can't match both .h and .cpp
When I comment the entire NativeOnKeyDown and its declaration in the header, there's no issues, as expected:
https://imgur.com/a/lXc36Di
Can you point the issue here? I couldn't find the problem here, and any help will be appreciated
I have implemented a class derived from UUserWidget, and I'm stuck in the following error:
https://imgur.com/a/4o3sFbU
And here is the output:
Code:
1>------ Build started: Project: PRJ_UI_Test, Configuration: Development_Editor x64 ------ 1>Building PRJ_UI_TestEditor... 1>Using Visual Studio 2019 14.22.27905 toolchain (D:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.22.27905) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10). 1>Building 3 actions with 12 processes... 1> [1/3] UE4Editor-PRJ_UI_Test-0011.lib 1> Creating library D:\GAME DEVELOPMENT\PROJECTS\UDEMY\LATEST\PRJ_UI_Test\Intermediate\Build\Win64\UE4Editor\Development\PRJ_UI_Test\UE4Editor-PRJ_UI_Test-0011.lib and object D:\GAME DEVELOPMENT\PROJECTS\UDEMY\LATEST\PRJ_UI_Test\Intermediate\Build\Win64\UE4Editor\Development\PRJ_UI_Test\UE4Editor-PRJ_UI_Test-0011.exp 1> [2/3] UE4Editor-PRJ_UI_Test-0011.dll 1> Creating library D:\GAME DEVELOPMENT\PROJECTS\UDEMY\LATEST\PRJ_UI_Test\Intermediate\Build\Win64\UE4Editor\Development\PRJ_UI_Test\UE4Editor-PRJ_UI_Test-0011.suppressed.lib and object D:\GAME DEVELOPMENT\PROJECTS\UDEMY\LATEST\PRJ_UI_Test\Intermediate\Build\Win64\UE4Editor\Development\PRJ_UI_Test\UE4Editor-PRJ_UI_Test-0011.suppressed.exp 1>RngWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class FReply __cdecl FReply::Handled(void)" (__imp_?Handled@FReply@@SA?AV1@XZ) referenced in function "protected: virtual class FReply __cdecl URngWidget::NativeOnKeyDown(struct FGeometry const &,struct FKeyEvent const &)" (?NativeOnKeyDown@URngWidget@@MEAA?AVFReply@@AEBUFGeometry@@AEBUFKeyEvent@@@Z) 1>RngWidget.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FReply::~FReply(void)" (__imp_??1FReply@@QEAA@XZ) referenced in function "protected: virtual class FReply __cdecl URngWidget::NativeOnKeyDown(struct FGeometry const &,struct FKeyEvent const &)" (?NativeOnKeyDown@URngWidget@@MEAA?AVFReply@@AEBUFGeometry@@AEBUFKeyEvent@@@Z) 1>D:\GAME DEVELOPMENT\PROJECTS\UDEMY\LATEST\PRJ_UI_Test\Binaries\Win64\UE4Editor-PRJ_UI_Test-0011.dll : fatal error LNK1120: 2 unresolved externals 1>D:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command ""D:\Program Files\Epic Games\UE_4.25\Engine\Build\BatchFiles\Build.bat" PRJ_UI_TestEditor Win64 Development -Project="D:\GAME DEVELOPMENT\PROJECTS\UDEMY\LATEST\PRJ_UI_Test\PRJ_UI_Test.uproject" -WaitMutex -FromMsBuild" exited with code 6. 1>Done building project "PRJ_UI_Test.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I think that, for some reason, when creating the .OBJ, the linker isn't finding the implementation for the FReply::Handled() and can't match both .h and .cpp
When I comment the entire NativeOnKeyDown and its declaration in the header, there's no issues, as expected:
https://imgur.com/a/lXc36Di
Code:
Candidate modules for hot reload: PRJ_UI_Test Launching UnrealBuildTool... [D:/Program Files/Epic Games/UE_4.25/Engine/Binaries/DotNET/UnrealBuildTool.exe -ModuleWithSuffix=PRJ_UI_Test,4370 PRJ_UI_TestEditor Win64 Development -Project="D:/GAME DEVELOPMENT/PROJECTS/UDEMY/LATEST/PRJ_UI_Test/PRJ_UI_Test.uproject" "D:/GAME DEVELOPMENT/PROJECTS/UDEMY/LATEST/PRJ_UI_Test/PRJ_UI_Test.uproject" -IgnoreJunk] Warning: Starting HotReload took 0.1s. CompilerResultsLog: New page: Compilation - Aug 18, 2020, 12:44:23 AM CompilerResultsLog: Building PRJ_UI_TestEditor... CompilerResultsLog: Using Visual Studio 2019 14.22.27905 toolchain (D:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.22.27905) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10). CompilerResultsLog: Building 3 actions with 12 processes... CompilerResultsLog: [1/3] UE4Editor-PRJ_UI_Test-4370.lib CompilerResultsLog: Creating library D:\GAME DEVELOPMENT\PROJECTS\UDEMY\LATEST\PRJ_UI_Test\Intermediate\Build\Win64\UE4Editor\Development\PRJ_UI_Test\UE4Editor-PRJ_UI_Test-4370.lib and object D:\GAME DEVELOPMENT\PROJECTS\UDEMY\LATEST\PRJ_UI_Test\Intermediate\Build\Win64\UE4Editor\Development\PRJ_UI_Test\UE4Editor-PRJ_UI_Test-4370.exp CompilerResultsLog: [2/3] UE4Editor-PRJ_UI_Test-4370.dll CompilerResultsLog: Creating library D:\GAME DEVELOPMENT\PROJECTS\UDEMY\LATEST\PRJ_UI_Test\Intermediate\Build\Win64\UE4Editor\Development\PRJ_UI_Test\UE4Editor-PRJ_UI_Test-4370.suppressed.lib and object D:\GAME DEVELOPMENT\PROJECTS\UDEMY\LATEST\PRJ_UI_Test\Intermediate\Build\Win64\UE4Editor\Development\PRJ_UI_Test\UE4Editor-PRJ_UI_Test-4370.suppressed.e xp CompilerResultsLog: [3/3] PRJ_UI_TestEditor.target CompilerResultsLog: Total time in Parallel executor: 0.86 seconds CompilerResultsLog: Total execution time: 1.38 seconds LogMainFrame: MainFrame: Module compiling took 1.458 seconds LogContentBrowser: Native class hierarchy updated for 'PRJ_UI_Test' in 0.0012 seconds. Added 5 classes and 2 folders. Display: HotReload successful (3 functions remapped 0 scriptstructs remapped) LogContentBrowser: Native class hierarchy populated in 0.0117 seconds. Added 3432 classes and 823 folders. Display: HotReload took 2.5s. LogRenderer: Reallocating scene render targets to support 1212x572 Format 10 NumSamples 1 (Frame:5348). LogRenderer: Reallocating scene render targets to support 1272x572 Format 10 NumSamples 1 (Frame:5350). LogRenderer: Reallocating scene render targets to support 1288x572 Format 10 NumSamples 1 (Frame:5352). LogRenderer: Reallocating scene render targets to support 1320x572 Format 10 NumSamples 1 (Frame:5354). LogRenderer: Reallocating scene render targets to support 1344x572 Format 10 NumSamples 1 (Frame:5356). LogRenderer: Reallocating scene render targets to support 1356x572 Format 10 NumSamples 1 (Frame:5358). LogRenderer: Reallocating scene render targets to support 1360x572 Format 10 NumSamples 1 (Frame:5360). LogRenderer: Reallocating scene render targets to support 1364x572 Format 10 NumSamples 1 (Frame:5362). LogRenderer: Reallocating scene render targets to support 1372x572 Format 10 NumSamples 1 (Frame:5364). LogRenderer: Reallocating scene render targets to support 1376x572 Format 10 NumSamples 1 (Frame:5366). LogRenderer: Reallocating scene render targets to support 1384x572 Format 10 NumSamples 1 (Frame:5368). LogRenderer: Reallocating scene render targets to support 1392x572 Format 10 NumSamples 1 (Frame:5370). LogRenderer: Reallocating scene render targets to support 1400x572 Format 10 NumSamples 1 (Frame:5372). LogRenderer: Reallocating scene render targets to support 1404x572 Format 10 NumSamples 1 (Frame:5374).
Can you point the issue here? I couldn't find the problem here, and any help will be appreciated

Comment