Our sample games all seem to use the semi-deprecated Classes folder for their headers, and many of these headers omit a #pragma once (or other header guard).

This means that they don't play nicely when using the in-editor class wizard, as an attempt to include a header without a header guard results in multiply defined symbols and a build error. They also seem to have include path issues as the Classes headers can't be included by the Private source files.

I'd propose moving all of our samples over to use the Public or Private folder for their headers, and then ensure that they all have appropriate header guards. This will match better with what the editor expects, and removes the use of a semi-legacy feature from what should be "best practice" examples.

Steps to Reproduce

1) Open ShooterGame.
2) Create a new class derived from AShooterWeapon_Instant.
3) Observe that you get an error about a multiply included header.
4) Remove the include for the base class from your new classes header.
5) Observe that you get an error trying to include your new classes header.
6) Remove the include for your header from your new classes source file.
7) Observe that things now build. Steps 4 and 6 should not be required!

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

Login to Vote

ComponentDocs - Samples
Affects Versions4.74.8
Target Fix4.8
Fix Commit2506631
CreatedMar 30, 2015
ResolvedApr 9, 2015
UpdatedApr 27, 2018