Unable to add code to project

Edit: Description: I tried to add a widget class to the project. When it fails, the code’s .cpp and .h files exist in the VS Project but not in the engine. The class could derive from any base class (and it will fail to compile), but I am showing here an example of UserWidget.

Edit 2: I posted this question earlier. [Link][1] (consider what in there as methods I tried)

Binary version

Version: 4.7.6-2531093

Log Output:

Recompiling VikingKing...
Launching UnrealBuildTool... [D:/Program Files/UE4/Unreal Engine/4.7/Engine/Binaries/DotNET/UnrealBuildTool.exe VikingKing -ModuleWithSuffix VikingKing 1697 Win64 Development -editorrecompile -canskiplink "D:/Yarden Utilite/UE4 Projects/VikingKing/VikingKing.uproject" -rocket  -rocket]
CompilerResultsLog: New page: Compilation - Apr 24, 2015, 7:41:33 PM
CompilerResultsLog: Info Parsing headers for VikingKingEditor
CompilerResultsLog:Error: Error D:/Yarden Utilite/UE4 Projects/VikingKing/Source/VikingKing/MyUserWidget.h(11)  : Error: Superclass UserWidget of class MyUserWidget not found
CompilerResultsLog:Error: Error Error: Failed to generate code for VikingKingEditor - error code: OtherCompilationError (2) 
CompilerResultsLog: Info UnrealHeaderTool failed for target 'VikingKingEditor' (platform: Win64, module info: D:\Yarden Utilite\UE4 Projects\VikingKing\Intermediate\Build\Win64\VikingKingEditor\Development\UnrealHeaderTool.manifest).
LogMainFrame: MainFrame: Module compiling took 5.742 seconds
Warning: HotReload failed, recompile failed
Warning: RebindPackages failed because the compiler could not be started.

Repro:

UUserWidget is in the UMG module. You’ll need to make sure that the UMG module is referenced as a dependency in your projects .Build.cs file.

@Jamie Dale

Also happens when I try to add a character class.

Same error?

@Jamie Dale

Same error.

Edit: Never-mind. fixed somehow.

If it was literally the same error (Error: Superclass UserWidget of class MyUserWidget not found) then it just sounds like the original error hadn’t been fixed and was still happening when new code was added.

Is UMG listed in your required dependencies in your .Build.cs file?

Source was a file that was not deleted… I will add required dependencies. Thanks.