# Does UBT flatten source directory structures, creating header file name collisions?

**URL:** <https://forums.unrealengine.com/t/does-ubt-flatten-source-directory-structures-creating-header-file-name-collisions/502121>\
**Category:** C++\
**Tags:** unreal-engine, ubt, question, UE4-27, CPP\
**Created:** [February 25, 2022, 4:25pm UTC](https://forums.unrealengine.com/t/does-ubt-flatten-source-directory-structures-creating-header-file-name-collisions/502121 "2022-02-25T16:25:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![STARGAZY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@STARGAZY](https://forums.unrealengine.com/u/STARGAZY)\
**Post date:** [February 25, 2022, 4:25pm UTC](https://forums.unrealengine.com/t/does-ubt-flatten-source-directory-structures-creating-header-file-name-collisions/502121/1 "2022-02-25T16:25:20Z")

</div>

Build issue, looking for advice if anyone can help.

I’ve got multiple source projects in a single game module.

I suspect that UBT is flattening my source directory structures, creating header file name collisions.

e.g. “Bar.h” conflicts with “foo/Bar.h”, but only at build-time, not in the IDE. N.B. Class names differ [ABar / foo::Bar], so this appears to be a file naming problem.

Is this expected?

Is there a UBT option to respect directory paths at build time?

Error:

```auto
UnrealBuildTool : error : Unable to merge actions producing Bar.cpp.obj: prerequisites are different [G:\filestore\development\unreal\foo\Intermediate\ProjectFiles\foo.vcxproj]
UnrealBuildTool : error : Action graph is invalid; unable to continue. See log for additional details. [G:\filestore\development\unreal\foo\Intermediate\ProjectFiles\foo.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command ""P:\filestore\games\Epic Games\UE_4.27\Engine\Build\BatchFiles\Build.bat" fooEditor Win64 Development -Project="G:\filestore\development\unreal\foo\foo.uproject" -WaitMutex -FromMsBuild" exited with code 6. [G:\filestore\development\unreal\foo\Intermediate\ProjectFiles\foo.vcxproj]"

```

Code:

[Private/Bar.h]

```auto
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Bar.generated.h"

UCLASS()
class FOO_API ABar : public AActor
{
    GENERATED_BODY()

public:
    // Sets default values for this actor's properties
    ABar();

protected:
    // Called when the game starts or when spawned
    virtual void BeginPlay() override;

public:
    // Called every frame
    virtual void Tick( float DeltaTime ) override;
};

```

[Private/foo/Bar.h]

```auto
#pragma once

namespace foo
{
    class Bar
    {
        Bar();
    };
}

```
