# "Failed to call \`y()\` to execute the macro" Error

**URL:** <https://root-forum.cern.ch/t/failed-to-call-y-to-execute-the-macro-error/58883>\
**Category:** Newbie\
**Tags:** root\
**Created:** [April 7, 2024, 1:48pm UTC](https://root-forum.cern.ch/t/failed-to-call-y-to-execute-the-macro-error/58883 "2024-04-07T13:48:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noname](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/58f4c7/32.png) [@Noname](https://root-forum.cern.ch/u/Noname)\
**Post date:** [April 7, 2024, 1:48pm UTC](https://root-forum.cern.ch/t/failed-to-call-y-to-execute-the-macro-error/58883/1 "2024-04-07T13:48:51Z")

</div>

Hi, I am quite new to the root and in general all concepts surrounding it. I installed it on Ubuntu manually ,including all dependencies. I can call and run root for basic things like 1+1 but when I use an text file and add my code in it, it won’t work.

**Sample Code in the Text**

```auto
void x()
{
 TH1F *hist = new TH1F("hist", "Histogram", 100, 0, 100);
 TCanvas *c1 = new TCanvas();
hist-> Draw();
}

```

**Codes in the Console**

```auto
source root/bin/thisroot.sh

mkdir x

cd x

gedit y.C

root y.C

```

**Message I Get:**

```auto
cling::DynamicLibraryManager::loadLibrary(): libtbb.so.12: cannot open shared object file: No such file or directory
root [0] 
Processing y.C...
warning: Failed to call `y()` to execute the macro.
Add this function or rename the macro. Falling back to `.L`.

```

I tried a simple **hello world** code directly on the console which worked but when I used same code in the text file (y) and try to run it by root in the console it didn’t work.

**ROOT Version:** 6.30.6  
**Platform:** Ubuntu 22.04.04 LTS (Virtual Machine on Win11)  
**Compiler:** -

---

<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:** [April 7, 2024, 2:27pm UTC](https://root-forum.cern.ch/t/failed-to-call-y-to-execute-the-macro-error/58883/2 "2024-04-07T14:27:24Z")

</div>

If the function in the macro is called x, your macro file should also be named x, i.e. x.C

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