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"

VS cannot find generated.h files

  1. UE 4.20 clean fresh installation.

  2. Created New project - C++ Base Code

  3. In UE Editor double click on C++ Classes \ MyProject \ MyProjectBameModeBase (generated during the project creation)

  4. VS 2017 automatically opened

  5. There's an error: cannot open file MyProjectGameModeBase.generated.h

https://imgur.com/xKvue5e

The exact same error every time I try to add new C++ class via UE Editor (for example an Actor class).

Any ideas?

Thanks.

Edit: I tried the trick with deleting files (.vs, Binaries, Intermediate, Saved, *.snl) and re-generating VS project file, but it didn't help.

Product Version: UE 4.20
Tags:
more ▼

asked Jul 21 '18 at 01:12 PM in C++ Programming

avatar image

x27
73 2 3 6

avatar image TheAwesomeGem Jul 22 '18 at 02:10 AM

Having the same issue.

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

1 answer: sort oldest

It's clearly a bug introduced in 4.20. I don't understand how this build was approved by QA with such a bug.

Anyway, I found out what is happening and how to solve it manually. You will have to do this everytime after you generate the project files (annoying but currently is the only way).

The problem is that the UBT is not adding the intermediate include directories to the NMakeIncludeSearchPath property in the visual studio project when it generates the project files.

Workaround:

  1. Open the project solution

  2. Inside Visual Studio go to Project -> Properties

  3. In configuration select "All Configurations"

  4. In the Configuration Properties tree select NMake

  5. Click the dropdown for the "Include Search Path" item and select "Edit..."

  6. Click the "New Line" button at the top right of the window and add this path "..\Build\Win64\UE4Editor\Inc\YourModuleName" without the quotes.

  7. Repeat step 6 for each c++ module in your project

Let me know if this helps you until Epic makes a hotfix for this.

more ▼

answered Jul 22 '18 at 03:08 AM

avatar image

Sveitar
1k 8 24 28

avatar image Iansa Jul 22 '18 at 05:04 AM

That did not work for me...

avatar image Sveitar Jul 22 '18 at 07:55 PM

Sorry, my bad, I fixed the path.

avatar image x27 Jul 22 '18 at 09:48 AM

Thanks for the answer, Sveitar. It helped me to solve the issue with the include, but I'm still getting other errors https://imgur.com/qSV3ICT

I guess I'll wait for the fix.

avatar image CoolOppo Jul 27 '18 at 04:49 AM

Thank you so much for figuring this out. I was excited to use IntelliSense and it was extremely frustrating that it wasn't working correctly at all. I appreciate you taking the time to make the issue and spread the solution around; hopefully Epic sees this SOON!

Edit: Also, you accidentally put a double backslash in the path before YourModuleName.

avatar image Sveitar Jul 27 '18 at 08:00 PM

Fixed. Thank you!

avatar image EliasPa Aug 01 '18 at 07:40 PM

Thank you so much for this answer. However, I'm still a bit confused by step 6 in the answer and I have a couple of stupid questions:

What exactly should I replace the YourModuleName with? Is it every C++ header file or the actual C++ files? Sorry I'm new at this.

Thanks in advance!

avatar image Sveitar Aug 01 '18 at 08:14 PM

By default when you create a C++ project in UE4 one gameplay module is automatically created with the same name as your project. So you can put your project's name there.

In bigger projects this may be different as you can add multiple gameplay modules and even editor modules.

I recommend you read the gameplay modules documentation. It's fundamental to understand them while programming with C++ for UE4 and you may find useful to configure multiple modules when working on a medium to big sized project

https://docs.unrealengine.com/en-us/Programming/Modules/Gameplay

Hope that gets you up and running.

avatar image Chris Payne Kuju Jan 14 '19 at 08:58 PM

Can't see how this will help because mine is failing on generated.h files that are part of UE4 (and genuinely do not exist).

avatar image victorqueiroz Jan 31 '19 at 07:44 PM

This is still a bug (at least on Linux) for commit hash 811c1ce579564fa92ecc22d9b70cbe9c8a8e4b9a (tested on CLion and Qt Creator)

avatar image kakyoism Apr 26 '19 at 12:45 PM

Still have this problem and adding

$(ProjectDir)....\Build\Win64\UE4Editor\Inc\MyModuleName

didn't help. Seems that something internal bypassed the include search path.

avatar image RexInMonte Jul 07 '19 at 07:36 AM

Because I still had this issue today with the newest version I would like to add. Don't forget to save the .sln. Easied way to do this is just closing VS after adding the path and it will ask you to save the file. Open VS again and everything should be fine.

Thanks for the fix btw.

(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