Announcement

Collapse
No announcement yet.

I keep having the Cannot open source file "Filename.generated.h" error.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    I keep having the Cannot open source file "Filename.generated.h" error.

    So, I'm pretty new to Unreal Engine and C++. I was following the C++ Tank vs Zombies tutorial on YouTube, but on the 3rd video
    I started to run into a problem. In my Gun.h class, I started to get an error on my #include "Gun.generated.h" class. It says: Cannot open source file "Gun.generated.h".

    Click image for larger version

Name:	error.png
Views:	140
Size:	6.2 KB
ID:	1576580

    I thought it was because of the "class AIceGirl" underneath it, so I commented that out and compiled the project again. But now I'm getting this error and I have no idea what it means.

    Click image for larger version

Name:	error2.png
Views:	50
Size:	32.5 KB
ID:	1576582

    Here's the code of the Gun.h class:

    Click image for larger version

Name:	code1.png
Views:	50
Size:	55.7 KB
ID:	1576587

    Click image for larger version

Name:	Code2.png
Views:	49
Size:	18.9 KB
ID:	1576583
    Attached Files

    #2
    1) check if your ICEDEFENDER_API matches the module name
    2) check if your .cs file has the following lines
    Code:
      PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
    
    
    PublicIncludePaths.Add (Path.Combine (ModuleDirectory, "Public"));
    PrivateIncludePaths.Add (Path.Combine (ModuleDirectory, "Private"));
    if you use version < 4.18 (? 4.19) use the lines above and uncomment out the lines like
    Code:
    /* PublicIncludePaths.AddRange ...
    /* PrivateIncludePaths.AddRange ...
    upd: your error lnk1169
    check if you connect the .cpp file twice
    Check if you connect .cpp in the .h file
    this is a common error in C ++ if the .cpp file is connected twice
    Last edited by Babush61; 01-25-2019, 09:58 AM.
    Plugin for HISM and ISMC https://www.unrealengine.com/marketp...nstance-editor

    Comment


      #3
      Intellisense errors (the squiggly red line) aren't real errors, generally speaking when using Unreal. Intellisense has a terrible time parsing UE code (which is why so many people use Visual Assist instead).

      Your build is failing because "UIceGirlStatics::FindLookAtAngel2D" is apparently defined twice.
      Able Ability System - A high performance, robust ability system for UE4. Now Available!

      Comment

      Working...
      X