# Compilation problem of a macro

**URL:** <https://root-forum.cern.ch/t/compilation-problem-of-a-macro/53451>\
**Category:** Newbie\
**Created:** [February 3, 2023, 5:24pm UTC](https://root-forum.cern.ch/t/compilation-problem-of-a-macro/53451 "2023-02-03T17:24:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spyhunter01](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/spyhunter01/32/23019_2.png) [@spyhunter01](https://root-forum.cern.ch/u/spyhunter01)\
**Post date:** [February 3, 2023, 5:24pm UTC](https://root-forum.cern.ch/t/compilation-problem-of-a-macro/53451/1 "2023-02-03T17:24:29Z")

</div>

Hi experts,

Could you please help me to spot the problem of compilation here? I can run the macro with .x name.cpp ; however, it doesn’t work when I run and compile with .x name.cpp++.

The file was quite long, but I tried to cut it short. Please, ignore the positioning of stuff in the plot. My focus is compiling issue.

Input File and the macro file are attached here:  
[MAC.txt](https://root-forum.cern.ch/uploads/short-url/6jBBCJPDVxcAV6ps7Q0dW8iRE5.txt) (475 Bytes)

[PlotTest.cpp](https://root-forum.cern.ch/uploads/short-url/tlTk4mD8J3rjJiO84qB2cjAIVup.cpp) (3.4 KB)

You need to enter “MAC” as the input file name when it asks. It does ask and run without compilation.

Cheers.

Part of the terminal message when I compile is below:

sh: -c: line 0: unexpected EOF while looking for matching `"’

sh: -c: line 1: syntax error: unexpected end of file

Error in : Executing 'cd “/Users/spyhunter0066/Library/CloudStorage/OneDrive-harran.edu.tr/c++” ; clang++ -fPIC -c -O3 -DNDEBUG -std=c++17 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++ -I/opt/homebrew/Cellar/root/6.26.06\_1/include/root -isysroot "/Applications/Xcode.app/Contents/D

---

<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 3, 2023, 5:42pm UTC](https://root-forum.cern.ch/t/compilation-problem-of-a-macro/53451/2 "2023-02-03T17:42:15Z")

</div>

It ran without errors for me (Ubuntu on WSL):

```auto
   ------------------------------------------------------------------
  | Welcome to ROOT 6.26/10 https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Nov 16 2022, 10:42:54 |
  | From tags/v6-26-10@v6-26-10 |
  | With c++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------------

root [0] .x PlotTest.cpp++
Info in <TUnixSystem::ACLiC>: creating shared library /mnt/d/./PlotTest_cpp.so
Please, put the inputfile name as MAC to plot:
MAC
myinput file name: MAC.txt
root [1]

```

It could be a problem with your ROOT installation or your system.

---

<div class="post-metadata">

**Author:** ![spyhunter01](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/spyhunter01/32/23019_2.png) [@spyhunter01](https://root-forum.cern.ch/u/spyhunter01)\
**Post date:** [February 3, 2023, 6:04pm UTC](https://root-forum.cern.ch/t/compilation-problem-of-a-macro/53451/3 "2023-02-03T18:04:17Z")

</div>

Thanks. Good to know. I may need to reinstall Root on my mac after this approval.

Do you have any suggestion to follow during installation on a Mac?

---

<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 3, 2023, 6:09pm UTC](https://root-forum.cern.ch/t/compilation-problem-of-a-macro/53451/4 "2023-02-03T18:09:23Z")

</div>

I don’t use Mac, but you should just follow the installation instructions. I don’t compile ROOT but I still install the required dependencies.

---

<div class="post-metadata">

**Author:** ![spyhunter01](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/spyhunter01/32/23019_2.png) [@spyhunter01](https://root-forum.cern.ch/u/spyhunter01)\
**Post date:** [February 3, 2023, 6:20pm UTC](https://root-forum.cern.ch/t/compilation-problem-of-a-macro/53451/5 "2023-02-03T18:20:30Z")

</div>

Does anybody know how to delete previous ROOT on Mac to reinstall a new one?

I think I used “brew install root” option when I install it.
