Alternative to including Engine.h
i am new to UE4 c++ programming but have some experience in c++. To get started i am following a udemy course on c++ programming in UE4. Unfortunately the version used is 4.10 and there have been some great changes since then. From what i've learned so far big header includes have been removed to save compile time. Unfortunately almost every function or class seems to be unknown to VS17 and the autocompletion often doesn't work. Including the "Engine.h" solves that issue but then I am back to including the big header file and the compiling times are very high. Is there a way to figure out what needs to be included for specific functions ?
asked Jun 04 '17 at 11:14 PM in C++ Programming
You use "CoreMinimal.h" and then include the headers everywhere they are needed. As an example, if you are using a UCameraComponent, you would add:
You would do this everywhere you need to. The compiler will tell you when there is a compiling issue. When that happens, go to the docs page: https://docs.unrealengine.com
Then, search whatever you are looking for, such as, "UCameraComponent". In the "API" tab, find the UCameraComponent page and click on it. The, scroll to the bottom of the page and it will show the module it belongs to as well as the header (.h) file location. Take the directory and file name then copy and paste as an include into the file that needs it.
answered Jun 04 '17 at 11:19 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here