# Confused about class header declarations for Unreal

**URL:** <https://forums.unrealengine.com/t/confused-about-class-header-declarations-for-unreal/1188210>\
**Category:** C++\
**Tags:** unreal-engine, question\
**Created:** [June 4, 2023, 4:34am UTC](https://forums.unrealengine.com/t/confused-about-class-header-declarations-for-unreal/1188210 "2023-06-04T04:34:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rootVIII](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rootVIII](https://forums.unrealengine.com/u/rootVIII)\
**Post date:** [June 4, 2023, 4:34am UTC](https://forums.unrealengine.com/t/confused-about-class-header-declarations-for-unreal/1188210/1 "2023-06-04T04:34:41Z")

</div>

Hi all I am going through some of the documentation and I realize that it’s a bit outdated as I have had to tweak things slightly in each example so far. I am looking at this one now and I am running into a similar issue as in some of the others, and I could use some clarification.

For example, this section of code/header file (found at [Components and Collision | Unreal Engine Documentation](https://docs.unrealengine.com/4.26/en-US/ProgrammingAndScripting/ProgrammingWithCPP/CPPTutorials/Components/))

```auto
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/PawnMovementComponent.h"
#include "CollidingPawnMovementComponent.generated.h"

UCLASS()
class HOWTO_COMPONENTS_API UCollidingPawnMovementComponent : public UPawnMovementComponent
{
    GENERATED_BODY()

public:
    virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;  
};

```

The above code throws errors with its associated .cpp file when building. But the code compiles successfully if I remove the `HOWTO_COMPONENTS_API` part just after the class keyword in the UCollidingPawnMovementComponent declaration.

What is this? It looks a bit foreign to me. And I seem to have the issue with each of the older UE4 examples. Thanks!

---

<div class="post-metadata">

**Author:** ![ugmoe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ugmoe](https://forums.unrealengine.com/u/ugmoe)\
**Post date:** [June 4, 2023, 6:26am UTC](https://forums.unrealengine.com/t/confused-about-class-header-declarations-for-unreal/1188210/2 "2023-06-04T06:26:39Z")

</div>

it’s because your project has a different name than HOWTO\_COMPONENTS

just put your project name there instead like

MYPROJECT\_API

---

<div class="post-metadata">

**Author:** ![MagForceSeven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/magforceseven/32/906563_2.png) [@MagForceSeven](https://forums.unrealengine.com/u/MagForceSeven)\
**Post date:** [June 4, 2023, 9:11pm UTC](https://forums.unrealengine.com/t/confused-about-class-header-declarations-for-unreal/1188210/3 "2023-06-04T21:11:45Z")

</div>

Either change it to the module name like ugmoe suggests or remove it (as you found).

That macro is part of the dll/module exporting functionality. The editor builds all the modules of a plugin (including your game module) as a dll (dynamic link library) so there has to be a little bit of extra info to specify what “things” should be accessible to those users of the dll.

If you’re not doing any plugin development or otherwise trying to organize your code across multiple plugins/modules then you can just omit this macro from any examples.

---

<div class="post-metadata">

**Author:** ![rootVIII](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rootVIII](https://forums.unrealengine.com/u/rootVIII)\
**Post date:** [June 6, 2023, 1:50am UTC](https://forums.unrealengine.com/t/confused-about-class-header-declarations-for-unreal/1188210/4 "2023-06-06T01:50:37Z")

</div>

> [@MagForceSeven](#):
>
> opment or otherwise trying to organize your code across multiple plugins/modules then you can just omit this macro from any examples.

Thank you both

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [July 6, 2023, 1:50am UTC](https://forums.unrealengine.com/t/confused-about-class-header-declarations-for-unreal/1188210/5 "2023-07-06T01:50:58Z")

</div>

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