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?
Right-click the Project->Properties->NMake->IntelliSense->Include Search Path, and there you just need to add:
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
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
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.
2) Switch to all configurations so the includes we add are added for every configuration.
3) Click in the "Include Directories" text box and paste the following:
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
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.
5) Finally you can press "Apply" and "Okay" to apply the include paths you have added and close the properties window.
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
I hope this helps make the fix for this issue a little easier for everyone!
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...
answered Jul 20 '18 at 09:45 PM
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)
And line 1054:
IsEngineInstalled? That is the difference between launcher version and source code version.
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.
answered Jul 19 '18 at 05:40 PM
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
answered Jul 28 '18 at 11:47 AM
so it not work today, i have this problem too not helping me
answered Aug 11 '18 at 09:34 AM
Still not fixed in 4.20...
answered Aug 15 '18 at 02:03 PM
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here