Trying to compile a custom class and the engine is trying to rebuild itself in VS.

Hello, I’m very new to UE4 and game engines in general. I’m a student and game artist for the most part but I have wanted to delve into Unreal for quite some time. I haven’t used an IDE in several years, most of the coding I do, I compile through a terminal so I might have not set up visual studio correctly to compile my project. I have some experience with UDK where my group would write .uc files and compile them without an IDE. Basically what I’m trying to do is follow the quick start programming guide on the documentation to create a hello world printer. When I’ve added the class and start editing it within VS I set “MyProject” as the start up project as well as right click and select build on “MyProject”. From what I can tell in the output window, VS is not compiling the .h and .cpp I have created rather it is rebuilding the entire engine. Is this necessary on the initial build of a project or is there something I need to set up to just compile the classes. I have also tried just editing the class in VS and reopening the editor and selecting compile, but it throws the warning that a header file has been changed and to recompile in the IDE.

This is some of the output I’ve been getting signaling that it’s rebuilding the entire engine.

… StatsViewer.generated.cpp
1> Module.NewsFeed.cpp
1> NewsFeed.generated.cpp
1> Module.DeviceProfileServices.cpp
1> [265/854] link.exe UE4Editor-ContentBrowser.dll
1> Creating library D:\UE4\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-ContentBrowser.lib and object D:\UE4\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-ContentBrowser.exp
1> [266/854] link.exe UE4Editor-SceneOutliner.dll
1> Creating library D:\UE4\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-SceneOutliner.lib and object D:\UE4\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-SceneOutliner.exp
1> [267/854] rc.exe PCLaunch.rc
1> [268/854] rc.exe PCLaunch.rc
1> [269/854] rc.exe PCLaunch.rc
1> [270/854] rc.exe PCLaunch.rc
1> [271/854] lib.exe UE4Editor-KismetCompiler.lib
1> Creating library D:\UE4\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-KismetCompiler.lib and object D:\UE4\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-KismetCompiler.exp
1> Module.LevelEditor.2_of_3.cpp
1> Module.LevelEditor.1_of_3.cpp
1> Module.LevelEditor.3_of_3.cpp
1> [275/854] link.exe UE4Editor-Blueprint …

Edit: Imgur: The magic of the Internet this is where I’ve been trying to build the project.

I really think something is wrong here cause I have never had an experience where it took 15+ minutes to compile a small .cpp file.
Any help is appreciated and I can further elaborate if need be. Thanks again for looking and any help.

Seems like I got the class to work after all but it took about 30 minutes to compile the project. Can someone confirm that you have to compile the project initially before making easy edits to the class.

You only have to compile the editor the first time (and any time you make changes to it). After the first compile, you can independently compile your game module on its own. If you don’t change any definitions, you can even compile from within the editor, without having to close it and re-open it.

Thanks! As for anything with a .h file does that require to be recompiled within visual studio anytime one is made?

Yep, that’s what I meant by changing any definitions (.h files). So if you do change anything there, you’ll have to close the editor and compile in VS. Good luck!