Explanation of the Issue
Simply adding a new class extended from class UPhysicsHandleComponent (@Runtime/Engine/Classes/PhysicsEngine/PhysicsHandleComponent) results in an error regarding unresolved external symbol related to UPhysicsHandleComponent::UpdateDriveSettings().
Steps to reproduce
- Create new C++ project or use any existing project
- In Content Browser add new class extended from “PhysicsHandleComponent”.
- Compile will fail with error shown in Log below
- The solution is now corrupted and needs to be cleaned out by deleting the new class & Intermediate folder, and regenerating the VS files.
Log
Candidate modules for hot reload:
PWNGame
Launching UnrealBuildTool… [C:/UnrealEngines/UE_4.17/Engine/Binaries/DotNET/UnrealBuildTool.exe PWNGame -ModuleWithSuffix PWNGame 8150 Win64 Development -editorrecompile -canskiplink “E:/UE4/TheFifthEstate/V008/PWNGame/PWNGame.uproject” ]
CompilerResultsLog: New page: Compilation - 12 Oct 2017, 7:54:21 AM
CompilerResultsLog: Performing full C++ include scan (hot reloading a new target)
CompilerResultsLog: Compiling game modules for hot reload
CompilerResultsLog: Parsing headers for PWNGameEditor
CompilerResultsLog: Running UnrealHeaderTool “E:\UE4\TheFifthEstate\V008\PWNGame\PWNGame.uproject” “E:\UE4\TheFifthEstate\V008\PWNGame\Intermediate\Build\Win64\PWNGameEditor\Development\PWNGameEditor.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -installed
CompilerResultsLog: Reflection code generated for PWNGameEditor in 6.6174089 seconds
CompilerResultsLog: Performing 5 actions (4 in parallel)
CompilerResultsLog: PWNPhysicsHandleComponent.cpp
CompilerResultsLog: PWNGame.init.gen.cpp
CompilerResultsLog: PWNPhysicsHandleComponent.gen.cpp
CompilerResultsLog: [4/5] Link UE4Editor-PWNGame-8150.dll
CompilerResultsLog: [5/5] Link UE4Editor-PWNGame-8150.lib
CompilerResultsLog: Creating library E:\UE4\TheFifthEstate\V008\PWNGame\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-PWNGame-8150.lib and object E:\UE4\TheFifthEstate\V008\PWNGame\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-PWNGame-8150.exp
CompilerResultsLog: Creating library E:\UE4\TheFifthEstate\V008\PWNGame\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-PWNGame-8150.suppressed.lib and object E:\UE4\TheFifthEstate\V008\PWNGame\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-PWNGame-8150.suppressed.exp
** CompilerResultsLog: Error: PWNPhysicsHandleComponent.cpp.obj : error LNK2001: unresolved external symbol “protected: virtual void __cdecl UPhysicsHandleComponent::UpdateDriveSettings(void)” (?UpdateDriveSettings@UPhysicsHandleComponent@@MEAAXXZ)**
CompilerResultsLog: Error: PWNPhysicsHandleComponent.gen.cpp.obj : error LNK2001: unresolved external symbol “protected: virtual void __cdecl UPhysicsHandleComponent::UpdateDriveSettings(void)” (?UpdateDriveSettings@UPhysicsHandleComponent@@MEAAXXZ)
CompilerResultsLog: Error: E:\UE4\TheFifthEstate\V008\PWNGame\Binaries\Win64\UE4Editor-PWNGame-8150.dll : fatal error LNK1120: 1 unresolved externals
CompilerResultsLog: ERROR: UBT ERROR: Failed to produce item: E:\UE4\TheFifthEstate\V008\PWNGame\Binaries\Win64\UE4Editor-PWNGame-8150.dll
CompilerResultsLog: Total build time: 11.64 seconds (Local executor: 0.00 seconds)
LogMainFrame: MainFrame: Module compiling took 11.816 seconds