Undeclared identifier when adding camera component to vehicle template

I’m making a bug report on behalf of Codezeero, who had issues in this thread. I’ve tried reproducing his issue and have found it to refuse to compile for me as well.

Repro steps:

  1. Create a C++ project with the simple vehicle template.
  2. Select the TP_VehiclePawn in the world
  3. In the details panel, click “Add Component”, then select “New C++ Component…”
  4. Create a component that inherits from “Camera Component”
  5. Observe refusal to compile with error:

CompilerResultsLog:Error: Error
L:\Programs\Epic
Games\4.12\Engine\Source\Runtime\Engine\Classes\Camera/CameraTypes.h(93)
: error C2065: ‘WORLD_MAX’: undeclared
identifier

Any ideas?

Hello ,

As this seems to only happen with this particular asset, which is part of one of our templates, this seems like a job for the samples team. I’ve placed a bug report in for the issue under the number UE-32004. Unfortunately I don’t have an idea for a workaround at the moment but I’ll be sure to update you here whenever any changes have been made to the report.

I think you just need to include EngineDefines.h to get that definition. I’ll add that to CameraTypes.h now

Hey James, I added the following to the camera component’s header file, and it worked.

#include "EngineMinimal.h"
#include "EngineDefines.h"

Thanks!

Hello Mathew,
Its not just limited to that particular asset, you guys might have to take a look at other assets too. In advanced car template I found adding a variable of a predefined engine object in a custom component do not work until you include the particular header file . example “TriggerVolume.h”

easy to reproduce create a custom Actor component in advanced vehicle c++ template and try to add variable of a ATriggerVolume* , you cannot until you include the header file of TriggerVolume.h it was not the case in older version I believe.

Hello Codezeero,

This is due to all of the templates only including EngineMinimal.h in their projectname.h files. In a blank C++ project, Engine.h is included instead. If you change that include, you shouldn’t have this problem anymore.

:slight_smile: yea i did that, Thank you.