x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How do i know what to include UE 4.16

Since i updated to the new engine i need to include engine.h... What can i do instead of using that because it's annoying that i have to add that #include "engine.h" in every cpp file i have. What are the other alternatives? without engine.h i cant use the IntelliSense the way i have learned and when i try to GetOwner()->GetName() it doesnt work because i dont have that header file included on my cpp.

Product Version: UE 4.16
Tags:
more ▼

asked Jun 05 '17 at 07:44 AM in C++ Programming

avatar image

Ninhow
1 1 2 2

avatar image Ninhow Jun 05 '17 at 01:26 PM

so with other words i need to add Engine.h in every cpp file of mine?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

You should just include Engine.h as it is the easiest way to do it. You have to include at least one other header file anyways, so just include Engine.h and be happier. If you want to know exactly what you would have to include to get any function just search through the source code of the engine.

HTH

more ▼

answered Jun 05 '17 at 09:27 AM

avatar image

NoobsDeSroobs
2.7k 107 35 180

avatar image HailstoneJosh Jun 05 '17 at 01:40 PM

This is definitely the simplest way. The alternative is to enable include what you use and include the header file of every class that you reference. This will reduce compile times but requires some extra work.

avatar image NoobsDeSroobs Jun 05 '17 at 09:48 PM

I just tested the FPS template. I saved 0.3 sec by not including Engine.h. Maybe over many many many files it is worth it.

avatar image Calrizien Jan 14 '18 at 10:06 PM

Lol yeah there's got to be some way to reconcile IWYU with Intellisense.Its worth the compile time in many cases; we're talkin workflow here!

avatar image hallohalloxd3 Sep 22 '17 at 02:14 PM

How would you know which Header you Need to include ( i'm watching a tutorial from before IWYU)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

when you are inheriting class Child from class Base, you only need to include "Engine.h" in Base.h, because then it gets included automatically in all the files that include "Base.h" and so on.

in other words simply put, included headers are inherited.

in other words put realistically - in C++ compiler must know all what Engine.h defines before these are being used in other files, therefore you must inform the compiler to check these definitions before, because otherwise the compilation order is not guaranteed to be in ascending order. it's like a case in which somebody would ask you to feed Bob, and that he will tlel you who is actually Bob after you feed him. it's illogical.

conclusion: it's C++. you can only do C++ C++ way.

more ▼

answered Sep 22 '17 at 03:26 PM

avatar image

Arty-McLabin
915 20 43 63

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question