Questions about .Build.cs... I really need your help!!!

Why sometimes, even after I add the relevant dependencies in the corresponding .Build.cs file as required by the documentation, I still cannot open the corresponding source files in .h and .cpp? How can I solve this problem? It is very common and I encounter it frequently, which makes me unable to proceed to the next step for a long time or force me to change the method.

For example, I have encountered this problem again. I want to use include “LevelVariantSetsActor.h”, and then I added “VariantManagerContent” as required by the documentation, but it still doesn’t work.

If you include the header from another header, you’ll need to add VariantManagerContent in the public dependencies array

Is that right? After adding it, it still doesn’t work, and it still says that the source file cannot be opened!

You already have everything for it to work by adding the dependency into the build file

Close your project
Delete the temp folders

  • Intermediate
  • Binaries
  • DerivedDataCache
  • .vs
    .sln file

Then right click the uproject file and choose regenerate project.
The intelisense should start working on launch