# Error with name of the script

**URL:** <https://root-forum.cern.ch/t/error-with-name-of-the-script/52768>\
**Category:** Newbie\
**Created:** [December 14, 2022, 9:59pm UTC](https://root-forum.cern.ch/t/error-with-name-of-the-script/52768 "2022-12-14T21:59:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamal](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://root-forum.cern.ch/u/jamal)\
**Post date:** [December 14, 2022, 9:59pm UTC](https://root-forum.cern.ch/t/error-with-name-of-the-script/52768/1 "2022-12-14T21:59:38Z")

</div>

Hi , i’m a cernroot beginner and i’m having trouble with a (maybe stupid) name question. For example, in Linux (i use Gedit to write my scripts), i’ve this file “test.C”:

int test()

{

printf(“TEST \n”);

return 0;

}

and, if i run “root test.C”, it works:

root [0]

Processing test.C…

TEST

(int) 0

but if i change the name in the script (not the name of the file in .C) as follows and i run “root test.C” it doesn’t work:

int main()

{

printf(“TEST \n”);

return 0;

}

this is the error

root [0]

Processing test.C…

warning: Failed to call `test()` to execute the macro.

Add this function or rename the macro. Falling back to `.L`.

Why this happens? And how could i solve this?

Thanks!!!

---

<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:** [December 15, 2022, 4:29am UTC](https://root-forum.cern.ch/t/error-with-name-of-the-script/52768/2 "2022-12-15T04:29:18Z")

</div>

> **[ROOT macros and shared libraries](https://root.cern/manual/root_macros_and_shared_libraries/)**
>
> Data Analysis Framework

Read all (using `main()` is also discussed).

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [December 15, 2022, 7:39am UTC](https://root-forum.cern.ch/t/error-with-name-of-the-script/52768/3 "2022-12-15T07:39:13Z")

</div>

Welcome to the ROOT forum

When you do:

```auto
root test.C

```

root will look at the `test()` method inside the file `test.C` [as explained in the Manual](https://root.cern/manual/root_macros_and_shared_libraries/#creating-root-macros).

---

<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:** [December 15, 2022, 10:47am UTC](https://root-forum.cern.ch/t/error-with-name-of-the-script/52768/4 "2022-12-15T10:47:26Z")

</div>

[ROOT Primer → ROOT Macros](https://root.cern/primer/#root-macros)
