# Undeclared identifier when adding camera component to vehicle template

**URL:** <https://forums.unrealengine.com/t/undeclared-identifier-when-adding-camera-component-to-vehicle-template/360727>\
**Category:** Cinematics & Media\
**Tags:** unreal-engine, bug-report, CPP, question\
**Created:** [June 14, 2016, 1:11pm UTC](https://forums.unrealengine.com/t/undeclared-identifier-when-adding-camera-component-to-vehicle-template/360727 "2016-06-14T13:11:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![HateDread](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HateDread](https://forums.unrealengine.com/u/HateDread)\
**Post date:** [June 14, 2016, 1:11pm UTC](https://forums.unrealengine.com/t/undeclared-identifier-when-adding-camera-component-to-vehicle-template/360727/1 "2016-06-14T13:11:34Z")

</div>

I’m making a bug report on behalf of Codezeero, who had issues in [this thread](https://forums.unrealengine.com/showthread.php?113696-What-s-Wrong-with-Unreal). 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?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [June 14, 2016, 3:54pm UTC](https://forums.unrealengine.com/t/undeclared-identifier-when-adding-camera-component-to-vehicle-template/360727/2 "2016-06-14T15:54:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Dig\_Squid](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dig_squid/32/1145423_2.png) [@Dig\_Squid](https://forums.unrealengine.com/u/Dig_Squid)\
**Post date:** [June 15, 2016, 9:28am UTC](https://forums.unrealengine.com/t/undeclared-identifier-when-adding-camera-component-to-vehicle-template/360727/3 "2016-06-15T09:28:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![HateDread](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HateDread](https://forums.unrealengine.com/u/HateDread)\
**Post date:** [June 15, 2016, 10:04am UTC](https://forums.unrealengine.com/t/undeclared-identifier-when-adding-camera-component-to-vehicle-template/360727/4 "2016-06-15T10:04:27Z")

</div>

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

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

```

Thanks!

---

<div class="post-metadata">

**Author:** ![Codezeero](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Codezeero](https://forums.unrealengine.com/u/Codezeero)\
**Post date:** [June 17, 2016, 7:22pm UTC](https://forums.unrealengine.com/t/undeclared-identifier-when-adding-camera-component-to-vehicle-template/360727/5 "2016-06-17T19:22:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [June 17, 2016, 8:07pm UTC](https://forums.unrealengine.com/t/undeclared-identifier-when-adding-camera-component-to-vehicle-template/360727/6 "2016-06-17T20:07:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Codezeero](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Codezeero](https://forums.unrealengine.com/u/Codezeero)\
**Post date:** [June 24, 2016, 7:39am UTC](https://forums.unrealengine.com/t/undeclared-identifier-when-adding-camera-component-to-vehicle-template/360727/7 "2016-06-24T07:39:27Z")

</div>

🙂 yea i did that, Thank you.
