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"

UE4.20 is missing the IntelliSense IncludePath for the *.generated.h files

Just updated my Engine to 4.20 (from source) and my VS2017 Projectfiles (regenerated) are missing the Include Path for the *.generated.h files. It still builds, but IntelliSense can't finde the headers. Adding the path by hand fixes it, but this isn't a real solution. Does anybody know, what in code I have to change, so the include will be added?


As workaround:

Right-click the Project->Properties->NMake->IntelliSense->Include Search Path, and there you just need to add: ..\Build\Win64\UE4Editor\Inc\$(ProjectName)


Update: also the Engine Project doesn't seem to have those IncludePaths for their generated files, so my guess it, that this is the effect of a change to the UnrealBuildTool

Product Version: UE 4.20
more ▼

asked Jul 19 '18 at 04:45 AM in C++ Programming

avatar image

146 2 6 9

avatar image TacoShank Jul 19 '18 at 05:40 AM

I'm also having this problem. How did you add the headers by hand? What path are they in?

avatar image Frigerius Jul 19 '18 at 07:28 AM

Eh its $(SolutionDir)Intermediate\Build\Win64\UE4Editor\Inc\NameOfYourProject In an older Project, I didn't regenerated it was written as ..\Build\Win64\UE4Editor\Inc\NameOfYourProject Both should work (since they are the same^^)

And for the How: Rightclick the Project->Properties->NMake->IntelliSense->Include Search Path, and there you just need to add it.

avatar image OSh1mA Jul 19 '18 at 11:19 AM

Same problem here, but project cant find ENGINE generated header files, like assetdata.generated.h and so on. Couldn't figure out how to add them by hand... Except that things compiles and work.

avatar image Frigerius Jul 19 '18 at 11:21 AM

Did you try, what I replied to TacoShank?

avatar image OSh1mA Jul 19 '18 at 11:30 AM

yes, didn't work.

avatar image Frigerius Jul 19 '18 at 11:38 AM

Ah, now I got it. They are located at different places, so you have to add all those Paths to your included paths. Why do you need them to be recognized by intellisense? Do you actually modify Engine Sources?

avatar image OSh1mA Jul 19 '18 at 11:45 AM

I didn't modify engine files, just convert project from 4.19 to 4.20. Even in fresh 4.19 project with one cpp file and no added code, after convert to 4.20 intellisense show tons of errors about generated.h files alt text

avatar image Frigerius Jul 19 '18 at 11:53 AM

just to be sure: that is just IntelliSense, but you can still build right?

avatar image OSh1mA Jul 19 '18 at 11:55 AM

yes, builds from editor and VS without errors

avatar image Frigerius Jul 19 '18 at 11:59 AM

then its like I said, you will have to add all include paths for those files. Or you will have to Ignore those errors until a fix comes up^^ Or someone figured out what has to be reverted, so those will be added by GenerateProjectFiles.

avatar image raditz_1 Sep 03 '18 at 05:29 PM

The related ticket (https://issues.unrealengine.com/issue/UE-62042) is marked fixed, but same issue here, so it's not fixed after all

avatar image Frigerius Sep 03 '18 at 06:04 PM

Then take my python script. KWS mentioned that there is another fix for it on github, which ist not included yet.

avatar image bggangel Sep 11 '18 at 01:28 PM

In case someone still has a problem: For me in the latest 4.20 code (after 4.20.3) it still was a problem. But when I added the following line to my myGame.Target.cs and myGameEditor.Target.cs it solved the problem (I am not using the python script): BuildEnvironment = TargetBuildEnvironment.Shared;

It needs to be added under the 'public myGameTarget' line. Maybe it helps you.

avatar image Miheev2 Dec 19 '18 at 03:34 AM

4.21.1 not fixed It's terrible, every time you update, add paths to manual, and most of the errors are still not corrected.

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

10 answers: sort voted first

Ok, here is my current workaround. The following python script should grab all directories we need: To Add those easy, go to Your gameProject\Intermediate\ProjectFiles\YourProject.vcxproj and add the resulting string. You can also try to add them via VS, but for me it didn't copied all paths oO

edit update this script will now automatically find the needed Includes paths and will add them to your Project. You will just need to save this code to a Python (3.6) Script, located in your GameProjects folder, next to the *sln file

edit fixed a rare bug in the script + moved the code to pastebin for simpler copy: https://pastebin.com/Vvu3WcJh

more ▼

answered Jul 21 '18 at 12:30 AM

avatar image

146 2 6 9

avatar image Frigerius Jul 24 '18 at 06:26 AM
avatar image Second_Fry Sep 11 '18 at 02:02 PM

return line in get_engine_root should be

 return split_[1].split('\\Build\\BatchFiles\\Build.bat')[0].replace('"', '')

Then it will work for projects in directories with spaces since it will remove " from line start.

avatar image Frigerius Sep 11 '18 at 03:24 PM

thx, updated the code and moved it to pastebin.

avatar image KWS Sep 12 '18 at 08:19 AM

Thanks to both of you. The script is awesome! Don't worry about the deleted comments. I actually did it this time to remove redundant info. :)

avatar image KWS Sep 12 '18 at 11:41 AM

EDIT: My bad. as Frigerius pointed out. I needed Python 3.6+.

EDIT2: Removed outdated hastebin link

ORIGINAL MESSAGE: I thought I would give this a try. I've never used python before but when I run it with py27x64 I'm getting this error:

 File "FixIncludePaths.py", line 7
   cur_proj_path = f'Intermediate\\ProjectFiles\\{project_name}.vcxproj'
 SyntaxError: invalid syntax

Is the website screwing with the characters or something? I already had to correct a single-space indent issue.

avatar image Frigerius Aug 28 '18 at 07:38 PM

Maybe, but you will need min py3.6, since format strings are not available in py2

avatar image KWS Sep 02 '18 at 01:32 AM

Tried again in Python 3.7. Everything worked perfectly! One click and boom. no more inaccessible generated.h errors!

There isn't a better/faster solution than this until 4.20.3 arrives (Presuming that does actually correct the issue). I can't begin to imagine the kind of insanity that led to your post having a negative score :S (Maybe due to the indent issue). but I at least brought it back to neutral standing. though it should be at least 9001. :)

Thank you Frigerius!!

avatar image KWS Sep 19 '18 at 03:17 PM

It seems 4.20.3 did actually fix the issue. :)

avatar image bggangel Sep 20 '18 at 01:08 PM

In case someone still has a problem: For me in the latest 4.20 code (after 4.20.3) it still was a problem. But when I added the following line to my myGame.Target.cs and myGameEditor.Target.cs it solved the problem (I am not using the python script): BuildEnvironment = TargetBuildEnvironment.Shared; (I also have "bUseSharedPCHs = true;" in my myGameEditor.Target.cs)

It needs to be added under the 'public myGameTarget' line. Maybe it helps you.

avatar image KWS Sep 20 '18 at 01:49 PM

That's strange. I created a new project/class in .3 and was not able to reproduce the issue.

I also recovered an old project from VC and regenerated VS files without needing to use the script as I usually do. so I can say with certainty that it works for me. Maybe because my Unreal dir has no spaces. ie. C:\UE_4.20\

avatar image vle07 Sep 21 '18 at 08:58 PM

I'm still getting the same generated.h errors even after updating 4.20.3, cleaning my project and deleting my intermediates/saved folders, and adding the edits that you mentioned :(

Anybody have any other ideas? It takes over four hours for me to rebuild my project and recompile all the shaders, so having to repeatedly do this every time a "fix" is issued is pretty frustrating. I've just given up on intellisense at this point.

Edit: I've tried running the python script on Python 3.7 but I'm getting this error: ...line 62, in _solution_file = glob("*.sln)[0] indexError: list index out of range

Maybe I'm not running the python script correctly. I saved the python file to my project directory, and used the windows 10 command prompt to call the file with the python executable.

avatar image Frigerius Sep 22 '18 at 07:41 AM

First of all you do not need to rebuild everything, and you should never press rebuild for your Project, since if you use UE from source, it will rebuild the engine. Second, you need to regenerate your Project files, so rightclick your .uproject and press smth like Generate Visual Studio project files, which will call the BuildTool to create all Files you need. The Python script needs to be in the same folder, your Projects .sln is, otherwise glob can't find it.

avatar image vle07 Sep 22 '18 at 04:17 PM

HI Frigerius, thanks for the reply. I do use UE from source, and I usually try to avoid rebuilding for that very purpose. Unfortunately, sometimes it will not build correctly (or blueprints will be out of sync) without first cleaning the project and deleting intermediate files. Epic recommends trying this whenever issues happen (especially when updating the engine). I have already regenerated my project files and have placed the script in the same folder as the project solution file. I've also made sure to rename my directories to avoid using spaces. I'm still not sure what the issue is. Is there a way to do this without using the python script? Thanks!

avatar image Frigerius Sep 22 '18 at 04:22 PM

Hm if Blueprints don't work, I just close my engine and build, so the old tmp dlls get deleted an everything gets a fresh build, I never needed to rebuild for that. If there would be an easier solution for fixing this, I wouldn't use my script^^ But the script shouldn't crash, since IndexError, as you know, means, that the array/list is empty, which would mean there is no solution file, but I can just guess, since I don't know your setup^^

avatar image vle07 Sep 22 '18 at 04:27 PM

Yeah, I think I'm just running the python script incorrectly from the command prompt, and it's not reading the correct directory (or maybe there's something weird with my directory names). I'll look into it some more.

avatar image Frigerius Sep 22 '18 at 04:53 PM

Do you run the CMD inside your folder amd call the script by full path, or did you to a cd in CMD to change your command execution environment to your project?

avatar image vle07 Sep 22 '18 at 05:24 PM

Yeah, I'm an idiot. I didn't change my working directory in the command prompt to my project folder before calling the python executable. I assumed that python would use the script's directory as the working directory (since I used the absolute paths to both the executable and the script file), but that's not the case.

So here are the steps for command line and python noobies like me: 1. Download and install python 3.7 2. Copy the python script into your project folder which also contains the sln file 3. Open up the windows command prompt and make sure to change your working directory to your project folder by typing cd [Full project directory] without the brackets 4. Finally, type in the full path to your python.exe file followed by the full path to your script.py file, and it should work.

Thanks for the help Frigerius, and the awesome script. It works great!

avatar image Frigerius Sep 22 '18 at 05:37 PM

You're welcome^^

avatar image KWS Sep 22 '18 at 11:34 PM

As a side tip. if you Shift + Right-click an empty space in your project dir, you'll get an option to open a Command/Powershell window (pre-set with that working dir)

alt text

Or even better: if you associate py files with Python and set correctly in your windows PATH, you can just double-click the script without ever needing to type anything, as then Python is executed from the working dir the script resides in.

alt text

PS. I notice both of you are running from source. so maybe the fix in .3 only applies to launcher builds.

avatar image garwalk Mar 03 '19 at 01:47 PM


I'm also running the engine built from source and I'm on 4.21.2, which by all accounts should be free of this infamous 4.20 bug. I could not figure out why I was still getting intellisense errors on my includes for "generated.h" files as well as certain Unreal Macros and Super calls on Pawn classes. I had tried EVERYTHING.

Setting BuildEnvironment = TargetBuildEnvironment.Shared in the MyGame*.Target.cs files SOLVED IT!!!!

As pointed out by FeiSuZZ further down this page, it's a bug with the "source version". By now the code in UEBuildTarget.cs that determines the default BuildEnvironment (e.g. what will be set if you DON'T make the above fix) has actually been moved to RulesAssembly.cs. But as it is the result is the 4.20 include/generation bug persists even in 4.21.x.

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

I'm gonna dump my solution that I came to from my forum post here. It turns out what others have suggested works, but as you run into new dependencies you will run into new file opening errors and will have to add new include folder paths. With this solution you add all the engine include folders at once so it should cover any project. (Well at least theoretically. It's possible include errors will show up for other random headers as well)

It's a little brute force but here's the solution:

1) Open up your Visual Studio project properties by right clicking on the project.

alt text

2) Switch to all configurations so the includes we add are added for every configuration.

alt text

3) Click in the "Include Directories" text box and paste the following:

alt text


4) For whatever reason if you click apply after pasting now it wont work. So after pasting the above click on the little dropdown button and then click on the <Edit...> option.

alt text

Now you should see all of the include paths populated in the window that pops up. Click "Okay" in this window to actually add the pasted include paths.

alt text

5) Finally you can press "Apply" and "Okay" to apply the include paths you have added and close the properties window.

alt text

That's it! Unfortunately Visual Studio is pretty simplistic when it comes to adding include directories. Instead of adding all the folders recurisvely with something like $(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\** we are forced to add every folder manually. Anyways, these include paths should work for any project, with any name, in any location, with UE4 installed to any location. So you don't really need to worry about anything with this solution, it's just plug and play.

I hope this helps make the fix for this issue a little easier for everyone!

more ▼

answered Jul 30 '18 at 12:45 PM

avatar image

76 7 8 11

avatar image arrpeatwo4 Sep 02 '18 at 02:46 AM

Have an upvote for a clear, detailed response with images, and doing the legwork of listing out all the files. You're the hero we need.

avatar image raditz_1 Sep 03 '18 at 05:37 PM

(4.20.2 here) 89 errors down to 4. Now I have errors "only" like class "UObject" has no member "BeginPlay". HUGE help, thanks!

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

Ok, little Update, this feature of adding generated files to the include path was removed from the UnrealBuildTool, found the places in code, trying to revert the behavior...

more ▼

answered Jul 20 '18 at 09:45 PM

avatar image

146 2 6 9

avatar image MissKraya Jul 20 '18 at 10:38 PM

This seems like a huge oversight by epic! Keep us updated on your progress.

avatar image Frigerius Jul 20 '18 at 10:39 PM

yeah, will do, Its hard to get into the Project, so it can take a while .... ^^


hm don't think that I will make it in next days. Takes too long, without deeper knowledge about the hole system, like "where comes the data from". Unluckily I don't have the time to take a rly deep look ... hopefully this will get fixed by someone already familiar the code^^

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

This is a bug from the source build. If you use launcher build(from unrealengine.com), this bug will be gone.

The 4.20.3 version: UBT -> UEBuildTarget.cs (line: 454)

                 // Set the default value for whether to use the shared build environment
                 if(RulesObject.BuildEnvironment == TargetBuildEnvironment.Default)
                     if(RulesObject.Type != TargetType.Program && (***UnrealBuildTool.IsEngineInstalled()*** || RulesObject.LinkType != TargetLinkType.Monolithic))
                         RulesObject.BuildEnvironment = TargetBuildEnvironment.Shared;
                         RulesObject.BuildEnvironment = TargetBuildEnvironment.Unique;

And line 1054:

                 // Set the build environment
                 bUseSharedBuildEnvironment = (Rules.BuildEnvironment == TargetBuildEnvironment.Shared);
                 if (bUseSharedBuildEnvironment)
                     AppName = GetAppNameForTargetType(Rules.Type);

IsEngineInstalled? That is the difference between launcher version and source code version.

more ▼

answered Oct 02 '18 at 01:14 PM

avatar image

16 1 1

avatar image bggangel Oct 02 '18 at 03:43 PM

that explains why my "workaround" by setting "BuildEnvironment = TargetBuildEnvironment.Shared;" worked for me (see above somewhere). Thanks for finding this out. Did you report it?

avatar image vle07 Oct 02 '18 at 07:42 PM

Should we just force RulesObject.BuildEnvironment = TargetBuildEnvironment.Shared? Or is there a better way to get the conditional to work with source builds? Thanks.

avatar image garwalk Mar 03 '19 at 02:00 PM

This bug is still around as of 4.21.2 but for the record the first snippet of code above (what was line 454 of UEBuildTarget.cs when you added your answer in October) has now been moved to RulesAssembly.cs. I'm pointing this out for the sake of anybody else in my situation who comes along to read this.

Either IsEngineInstalled() is a bad/incorrect flag to use when determining if BuildEnvironment should be Shared or not (Unique) or LinkType is erroneously set to Monolithic when it shouldn't be.

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


We've recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.



more ▼

answered Jul 19 '18 at 05:40 PM

avatar image Frigerius Jul 19 '18 at 05:42 PM

Hey, thanks, will report the issue then^^ Just thought someone could tell, where one could fix it in code ;)

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

I also had to add the following paths:

 C:\Program Files\Epic Games\UE_4.20\Engine\Intermediate\Build\Win64\UE4\Inc\Engine
 C:\Program Files\Epic Games\UE_4.20\Engine\Intermediate\Build\Win64\UE4\Inc\InputCore
more ▼

answered Jul 19 '18 at 08:31 PM

avatar image

Reflection Rip
6 1 1

avatar image Frigerius Jul 19 '18 at 08:50 PM

For me it is



avatar image Reflection Rip Jul 19 '18 at 08:55 PM

That is probably more appropriate. Thanks.

avatar image Frigerius Jul 19 '18 at 08:57 PM

Well that the rootpath may vary is obvious and wasn't my intention for the replay :D But your UE Project name seems to be just "UE4" and mine (or the one which is given, when building from source) is "UE4Editor" so I have a different Subfolder from "Win64" so people need to check what paths they need.

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

6666,it's works! 3q3q,and i have another question,my create class,the cpp file have the same problem:***.h can't be open,if write whole src it's work

more ▼

answered Jul 28 '18 at 11:47 AM

avatar image

1 2 4

avatar image 千层酥 Jul 28 '18 at 12:48 PM

3q,I have already solved it,like .generated.h,just edit ....\Source\MyProject\,add -----public-----in it's last

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

so it not work today, i have this problem too not helping me

more ▼

answered Aug 11 '18 at 09:34 AM

avatar image

6 4 5

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

Still not fixed in 4.20...

more ▼

answered Aug 15 '18 at 02:03 PM

avatar image

1 2 3 5

avatar image Frigerius Aug 15 '18 at 02:06 PM

https://issues.unrealengine.com/issue/UE-62042 well it got fixed, just not part of an hotfix.

avatar image Den_Saboteur Sep 20 '18 at 01:04 PM

Still not fixed in 4.20.3

avatar image Frigerius Sep 20 '18 at 01:06 PM

yeah, still using my script^^ But It got better ;)

avatar image Den_Saboteur Oct 19 '18 at 10:02 AM

Thanks for your script. Good work !

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

I've been having this problem in 4.20.3 after we upgraded from 4.19. But no one else on the team seems to be getting it. I found that in AddModuleToCompileEnvironment (in UEBuildModuleCPP.cs) the GeneratedCodeDirectory for my project was something like


But looking in my Intermediate folder I found that my generated code is in


I tried doing a string replace on the GeneratedCodeDirectory path to look in UE4Editor instead of MyProjectEditor before adding it to the IncludePaths. After regenerating project files my Intellisense seems to be finding my generated headers properly. I'm no longer seeing errors all over the place.

 // This directory may not exist for this module (or ever exist, if it doesn't contain any generated headers), but we want the project files
 // to search it so we can pick up generated code definitions after UHT is run for the first time.
 if(AutoGenerateCppInfo != null || (ProjectFileGenerator.bGenerateProjectFiles && GeneratedCodeDirectory != null))
     String s = GeneratedCodeDirectory.FullName;
     s = s.Replace("\\Build\\Win64\\MyProjectEditor\\Inc\\", "\\Build\\Win64\\UE4Editor\\Inc\\");
     DirectoryReference dr = new DirectoryReference(s);
more ▼

answered Oct 10 '18 at 11:01 PM

avatar image

1 2

(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