I’m currently working on a game and running into a problem when I try to compile my C++ classes. The problem started the other day when I attempted to compile some changes and the editor froze during the compile, or so I thought anyway so I force closed the editor to start over. Since then there is one line of code that seems to be the culprit but I don’t know why. It keeps crashing the editor. I looked in the log files and found this line which pointed me to a particular class:
[2017.04.11-03.50.18:194]LogModuleManager:Warning: ModuleManager: Unable to load module ‘C:/dev/projects/ue4/FarkleFriends/Binaries/Win64/UE4Editor-FarkleFriends-2093.dll’ because the file couldn’t be loaded by the OS.
The line that seems to be causing the problem is:
AFGameMode *farkleGameMode = (AFGameMode*) GEngine->GetWorld()->GetAuthGameMode();
I tried cleaning the Binaries directory, doing a clean build in Visual Studio, deleting and recreating AFGameMode. I’ve commented everything out in AFGameMode and still that line crashes the editor. When I comment it out the compile works fine. With it not commented, the editor freezes for a few seconds and this is what I see in the editor log:
Launching UnrealBuildTool... [C:/Program Files (x86)/Epic Games/4.15/Engine/Binaries/DotNET/UnrealBuildTool.exe FarkleFriends -ModuleWithSuffix FarkleFriends 5177 Win64 Development -editorrecompile -canskiplink "C:/dev/projects/ue4/FarkleFriends/FarkleFriends.uproject" ] Warning: Starting HotReload took 0.0s. CompilerResultsLog: New page: Compilation - Apr 11, 2017, 11:51:24 AM CompilerResultsLog: Info Compiling game modules for hot reload CompilerResultsLog: Info Parsing headers for FarkleFriendsEditor CompilerResultsLog: Info Running UnrealHeaderTool "C:\dev\projects\ue4\FarkleFriends\FarkleFriends.uproject" "C:\dev\projects\ue4\FarkleFriends\Intermediate\Build\Win64\FarkleFriendsEditor\Development\FarkleFriendsEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed CompilerResultsLog: Info Reflection code generated for FarkleFriendsEditor in 5.954069 seconds CompilerResultsLog: Info Performing 3 actions (2 in parallel) CompilerResultsLog: Info ScoreUtil.cpp CompilerResultsLog: Info [2/3] Link UE4Editor-FarkleFriends-5177.dll CompilerResultsLog: Info [3/3] Link UE4Editor-FarkleFriends-5177.lib CompilerResultsLog: Info Creating library C:\dev\projects\ue4\FarkleFriends\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-FarkleFriends-5177.lib and object C:\dev\projects\ue4\FarkleFriends\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-FarkleFriends-5177.exp CompilerResultsLog: Info Creating library C:\dev\projects\ue4\FarkleFriends\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-FarkleFriends-5177.suppressed.lib and object C:\dev\projects\ue4\FarkleFriends\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-FarkleFriends-5177.suppressed.exp CompilerResultsLog: Info Total build time: 14.61 seconds (Local executor: 4.07 seconds) LogMainFrame: MainFrame: Module compiling took 15.252 seconds LogModuleManager:Warning: ModuleManager: Unable to load module 'C:/dev/projects/ue4/FarkleFriends/Binaries/Win64/UE4Editor-FarkleFriends-5177.dll' because the file couldn't be loaded by the OS. Warning: HotReload failed, reload failed /Script/FarkleFriends. LogContentBrowser: Native class hierarchy populated in 0.0211 seconds. Added 2254 classes and 459 folders. Display: HotReload took 49.6s.
I can alter the code to avoid using this line but I’d still like to know what might be causing this. I have also attached a log from one of the failing builds I did. If anyone knows what might be causing the problem I’d love the help.Editor Log