# Rerunning root macro in an already active session

**URL:** <https://root-forum.cern.ch/t/rerunning-root-macro-in-an-already-active-session/58268>\
**Category:** Newbie\
**Tags:** root\
**Created:** [February 23, 2024, 11:37am UTC](https://root-forum.cern.ch/t/rerunning-root-macro-in-an-already-active-session/58268 "2024-02-23T11:37:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juwack](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/7bcc69/32.png) [@juwack](https://root-forum.cern.ch/u/juwack)\
**Post date:** [February 23, 2024, 11:37am UTC](https://root-forum.cern.ch/t/rerunning-root-macro-in-an-already-active-session/58268/1 "2024-02-23T11:37:02Z")

</div>

* * *

_ROOT Version:_ 6.30/04  
_Platform:_ lxplus  
_Compiler:_ g++ 11.4.1

* * *

Hi all,  
I run my root macro (see below) via `root test.C` works as expected. When however running it again from the root prompt with `.x test.C`, the following error is returned:

```auto
IncrementalExecutor::executeFunction: symbol '_ZSt7forwardIRKfEOT_RNSt16remove_referenceIS2_E4typeE' unresolved while linking [cling interface function]!
You are probably missing the definition of float const& std::forward<float const&>(std::remove_reference<float const&>::type&)
Maybe you need to load the corresponding shared library?

```

As I’m quite new to ROOT and C++ I’m not sure how to resolve this and any advice would be appreciated. My current work around is to quit the session and start a new one. Many thanks!

The macro:

```auto
#include <vector>

int test(){
    std::vector<float> dRs;
    float dR = 1.0;
    dRs.push_back(dR);
    return 1;
}

```

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [February 23, 2024, 12:25pm UTC](https://root-forum.cern.ch/t/rerunning-root-macro-in-an-already-active-session/58268/2 "2024-02-23T12:25:15Z")

</div>

You can load the macro (.L) once and then run it as function every time. E.g. if your macro file is test.C:

```auto
root [0] .L test.C
root [1] test()
(int) 1
root [2] test()
(int) 1
root [3]

```

If you do changes to the macro after it’s already loaded, load it again.
