Unreal #include PawnBase.h issue

Hello everyone

I’m having a small issue with an “#include PawnBase.h”. Unreal keeps giving me error messages about it, that it’s missing and I’m not sure where? Have I put one in the wrong place or missed an area where there should be one? I hope that makes sense.

Thank you








Are PawnTurret.h and PawnBase.h in the same folder?

Hello

@DanM , do you mean in the Unreal editor or the hard drive my MacBook?

Harddrive

No, it looks like they are in two separate folders.

Well that would be why “File.h” just looks in the current folder. The Source folder is within the include path so you can do either

#include ToonTanks/SomeFolder/PawnBase.h"

Or use the relative path from the current file. i.e. if PawnBase.h is within ToonTanks/Base and PawnTurret.h is within ToonTanks/Derived. Then this would work

#include "../Base/PawnBase.h"

. = current directory,
.. = parent directory.

That seems to have worked. Thank you very much.

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

Privacy & Terms