Compile Error regarding "PawnTank.generated.h" No such file or directory

Hi there, I am really struggling to solve this problem. Apologies if this has been answered already. i’ve been hunting but couldn’t find the solution.

I had just completed filling out the constructor for PawnTank.cpp (SpringArm and Camera). Once i saved and reopened Unreal and tried compiling the compile failed with the ‘PawnTank.generated.h’: No such file or directory.

Here’s the full Compiler Log:

Creating makefile for ToonTanksEditor (no existing makefile)
Parsing headers for ToonTanksEditor
Running UnrealHeaderTool “C:\Users\simon\Documents\Unreal Projects\ToonTanks\ToonTanks.uproject” “C:\Users\simon\Documents\Unreal Projects\ToonTanks\Intermediate\Build\Win64\ToonTanksEditor\Development\ToonTanksEditor.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -abslog=“C:\Users\simon\AppData\Local\UnrealBuildTool\Log_UHT.txt” -installed
Reflection code generated for ToonTanksEditor in 4.4059031 seconds
Building ToonTanksEditor…
Using Visual Studio 2019 14.27.29112 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Building 10 actions with 12 processes…
[1/10] Default.rc2
[2/10] SharedPCH.Engine.ShadowErrors.cpp
[3/10] PawnTank.cpp
C:\Users\simon\Documents\Unreal Projects\ToonTanks\Source\ToonTanks\Pawns\PawnTank.h(7): fatal error C1083: Cannot open include file: ‘PawnTank.generated.h’: No such file or directory
[4/10] ToonTanks.cpp
[5/10] PawnBase.cpp
[6/10] ToonTanks.init.gen.cpp
[7/10] PawnBase.gen.cpp

Here’s what i’ve tried so far:

  • Refreshing Visual Studio Code files but no luck
  • Deleting Binaries and rebuilding from Source but couldn’t rebuild as the compile still failed
  • had to drag Binaries out of Recycle Bin to get the Unreal project open again
  • deleting PawnTank.h/.cpp and filling them out again but i failed with the same error at the same spot
  • Now I’m lost so i would be infinitely grateful for any help

Here are some screenshots of the PawnTank.h/.cpp:

Also might be worth mentioning I seem to be having a particualrly hard time with Intelisense and permanent red squiggles but i hear its kind of standard for it to struggle with unreal. Still bugs me though :confused:

Thanks in advance
psybr

Could you try doing the following with Unreal closed

Ctrl + Shift + B > ToonTanksEditor Win64 Development Rebuild

See my post here.

Thanks for the help. I Just ran the Development Build you suggested and got the same generated.h no such file. Here’s the full log:

> Executing task in folder ToonTanks: Engine\Build\BatchFiles\Build.bat ToonTanks Win64 Development "C:\Users\simon\Documents\Unreal Projects\ToonTanks\ToonTanks.uproject" -waitmutex <

Creating makefile for ToonTanks (no existing makefile)
Parsing headers for ToonTanks
  Running UnrealHeaderTool "C:\Users\simon\Documents\Unreal Projects\ToonTanks\ToonTanks.uproject" "C:\Users\simon\Documents\Unreal Projects\ToonTanks\Intermediate\Build\Win64\ToonTanks\Development\ToonTanks.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="C:\Users\simon\AppData\Local\UnrealBuildTool\Log_UHT.txt" -installed
Reflection code generated for ToonTanks in 10.8463991 seconds
Building ToonTanks...
Using Visual Studio 2019 14.27.29112 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Building 9 actions with 12 processes...
  [1/9] Default.rc2
  [2/9] SharedPCH.Engine.ShadowErrors.cpp
  [3/9] PawnTank.cpp
  C:\Users\simon\Documents\Unreal Projects\ToonTanks\Source\ToonTanks\Pawns\PawnTank.h(7): fatal error C1083: Cannot open include file: 'PawnTank.generated.h': No such file or directory
  [4/9] ToonTanks.cpp
  [5/9] ToonTanks.init.gen.cpp
  [6/9] PawnBase.cpp
  [7/9] PawnBase.gen.cpp
The terminal process "C:\Windows\System32\cmd.exe /d /c Engine\Build\BatchFiles\Build.bat ToonTanks Win64 Development "C:\Users\simon\Documents\Unreal Projects\ToonTanks\ToonTanks.uproject" -waitmutex" terminated with exit code: 6.

Terminal will be reused by tasks, press any key to close it.

Appreciate the help Keith.

I tried deleting /vscod /Binaries /Intermediate and /Saved and generated VS project files but it failed with: ToonTanks could not be compiled. Try rebuilding from source manually"

I then tried the rebuild from VSCode DanM mentioned but it’s the same a story.

I’m positive it has something to do with the PawnTank c++ child class so i’m going to delete them and walk through it again. If that fails I guess i could try using VS community or maybe try the unreal 4.22 version of the project. Would that be worth a go?

oh and I forgot to include the vs “PROBLEMS” tab errors

PawnTank.h:

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (C:\Users\simon\Documents\Unreal Projects\ToonTanks\Source\ToonTanks\Pawns\PawnTank.cpp).
cannot open source file "UBT_COMPILED_PLATFORM/UBT_COMPILED_PLATFORMPlatformCompilerPreSetup.h" (dependency of "CoreMinimal.h")
cannot open source file "UBT_COMPILED_PLATFORM/UBT_COMPILED_PLATFORMPlatformTime.h" (dependency of "PawnBase.h")
cannot open source file "PawnTank.generated.h"

PawnTank.cpp:

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (C:\Users\simon\Documents\Unreal Projects\ToonTanks\Source\ToonTanks\Pawns\PawnTank.cpp).
cannot open source file "UBT_COMPILED_PLATFORM/UBT_COMPILED_PLATFORMPlatformCompilerPreSetup.h" (dependency of "PawnTank.h")

Cheers guys

Okay I think I’ve sorted it out. I managed to implement and compile the PawnTank files.

I tried a lot of things but I think it boiled down to:

  • deleting the project directories and generating vs files
  • deleting pawntank.h/.cpp - FYI i found a couple of syntax errors in my .h (no ‘;’ after forward declarations but that didn’t fix it. Intelisense missed it somehow)
  • setting up the c_cpp…json ‘defines’ again from the bull cow resources
  • copied .h and .cpp from lecture git commit
  • compile went smoothly!

Im relieved. I was about to throw in the towel.

thank muchly for the support

psybr

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms