# VS2022 can't find header files when I was trying to create a new module

**URL:** <https://forums.unrealengine.com/t/vs2022-cant-find-header-files-when-i-was-trying-to-create-a-new-module/1568040>\
**Category:** C++\
**Tags:** header, modules, unreal-engine, Visual-Studio, question, CPP\
**Created:** [December 28, 2023, 2:56pm UTC](https://forums.unrealengine.com/t/vs2022-cant-find-header-files-when-i-was-trying-to-create-a-new-module/1568040 "2023-12-28T14:56:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![11712138](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@11712138](https://forums.unrealengine.com/u/11712138)\
**Post date:** [December 28, 2023, 2:56pm UTC](https://forums.unrealengine.com/t/vs2022-cant-find-header-files-when-i-was-trying-to-create-a-new-module/1568040/1 "2023-12-28T14:56:34Z")

</div>

When I following the video [https://www.youtube.com/watch?v=53W2Kacw6TE&list=PL-m4pn2uJvXHL5rxdudkhqrSRM5gN43YN&index=10](https://www.youtube.com/watch?v=53W2Kacw6TE&list=PL-m4pn2uJvXHL5rxdudkhqrSRM5gN43YN&index=10), I’m trying to create a module by using my own component. I create the `.ccp` and `.h` file for the module and also changed the necessary files like `.Target.cs`, `...ModuleName.Build.cs`. When I include `Engine.h` or `UnrealEd.h` or `Modules/ModuleInterface.h` or `Modules/ModuleManager.h`. The IDE can’t complie them casue it can’t find those headers. How to fix this?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [December 29, 2023, 12:18am UTC](https://forums.unrealengine.com/t/vs2022-cant-find-header-files-when-i-was-trying-to-create-a-new-module/1568040/2 "2023-12-29T00:18:28Z")

</div>

> [@11712138](#):
>
> `UnrealEd`

`UnrealEd` is editor only. So when you compile it’s elements would be stripped out during the compile process.

Perhaps you can add editor conditions to not make the compiler go crazy

```auto
#if WITH_EDITOR
// editor code that uses unrealed module here
#endif

```

```auto
#if WITH_EDITORONLY_DATA

```

> **[Cooking witheditoronlydata vs witheditor - Gamedev Guide](https://ikrima.dev/ue4guide/packaging-cooking/cooking-witheditoronlydata-vs-witheditor/)**
>
> If you declare a property in a class inside a WITH\_EDITORONLY\_DATA only block, then the cooker will detect that and not cook it, UNLESS you override the Serialize function, in which case you are taking serialization into your own hands.

Same thing with including `UnrealEd.h` =\> it should also be encompassed by conditional WITH\_EDITORONLY\_DATA
