# Macros inside the Macros - #ifndef issue

**URL:** <https://root-forum.cern.ch/t/macros-inside-the-macros-ifndef-issue/45295>\
**Category:** Newbie\
**Created:** [June 8, 2021, 12:18am UTC](https://root-forum.cern.ch/t/macros-inside-the-macros-ifndef-issue/45295 "2021-06-08T00:18:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilomidze](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/i/e79b87/32.png) [@ilomidze](https://root-forum.cern.ch/u/ilomidze)\
**Post date:** [June 8, 2021, 12:18am UTC](https://root-forum.cern.ch/t/macros-inside-the-macros-ifndef-issue/45295/1 "2021-06-08T00:18:39Z")

</div>

_ROOT Version:_ 6.22/08  
_Platform:_ macosx64  
_Compiler:_ Not Provided

I have all the macro files in the same directory and was using them by directly including in the main macro, like:

```auto
#include "macro2name.C"

// some other code

```

(and again - this works)

Now, I want to add #includes in “macro2name.C”, which can be included in “macro1name.C”.  
However, I can’t guard double include via #ifndef - I get error…

Here is what I am trying.

In “macro2name.C” file:

```auto
#ifndef "macro2name"
#define "macro2name"

#include "macro3name"

// some code

#endif

```

in “macro1name.C” file

```auto
#include "macro2name"
#include "macro3name"

// some code

```

How Can I Implement #ifndef ?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [June 8, 2021, 7:27am UTC](https://root-forum.cern.ch/t/macros-inside-the-macros-ifndef-issue/45295/2 "2021-06-08T07:27:17Z")

</div>

You need to protect “macro3name”, too:

```cpp
#ifndef _macro3_included_
#define _macro3_included_
// original contents of macro3name comes here
#endif

```
