I’ve followed the updates in adding forward declarations and find they’ve broken TankAIController. It now will not compile. Here is a snip of the compile error log:
As you can see, ATank is not recognized, this despite a forward declaration in TankAIController.h and #include of Tank.h in TankAIController.cpp. Here is a snip of #includes in the .cpp file:
If I hover above the Intellisense error line for the first #include, the error states that source file TankAIController.h can not be opened though a window in VS with that file is open right next to it. When entering the #include for that line, Intellisense only suggests the generate file, not the .h file.
Here’s the #Includes from TankAIController.h as well as the tabs showing the two realted files open in the IDE.`
Are you using the Public/Private folders? If you are, try including “Public/TankAIController.h” instead. I think something changed in the Unreal/Visual Studio versions after the video was made, regarding include paths.
I don’t guarantee that’ll help, but it did fix similar issues for me in the past.
Following the Intellisense error to ground, I right-click it then open the source file and see that it is trying to look in a different directory for the header file than the one in which the header file actually sits. The header file lives in the Public folder with all of the other tank component header files. But Intellisense thinks it should be in the Private folder. Very weird. None of the other header files produce Intellisense errors in their respective cpp files
Retried adding Public - Intellisense error is gone but the compile errors persist.
The errors near the bottom are interesting, about how some of the methods are re-defined, or have the wrong signature. Could you share both the .cpp and .h, the entire files? Maybe there’s an issue with the contents of the header file that’s leading the compiler to not understand…
I finally found the issue. In the forward declaration for ATank, I type is Atank. Then, in the cpp file, I typed it ATank. Cases didn’t match, so files didn’t link properly.
Thanks for taking a look at it. Capitalization is one of the issues that’s sometimes hard for me to spot.