ROOT install on MacOs 15.1.1 XCode 16.1 Old Mac Intel Core I9

Hello,

I have installed root using homebrew. Root basics work, but trying to compile an app using root libraries produces the error below. It looks that it tries to use an ancient version of g++, but not the one provided by Xcode line tools. Below are the paths and error…

Many thanks,

Kirill

OOT_Exercises % echo $LD_LIBRARY_PATH                                             
/usr/local/Cellar/root/6.32.08/lib/root
kprok@MacBook-Pro-324 ROOT_Exercises % echo $PATH                                                        
/usr/local/Cellar/root/6.32.08/bin:/usr/local/bin:/usr/local/sbin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/TeX/texbin
kprok@MacBook-Pro-324 ROOT_Exercises % g++ demo_1.cxx $(root-config --glibs --cflags --libs) -o demo_1
g++: error: unrecognized command line option ‘-stdlib=libc++’
g++: error: unrecognized command line option ‘-stdlib=libc++’
g++: error: unrecognized command line option ‘-std=c++17’

Welcome to the ROOT forum.

Usually a simple way to build your own application is:

`root-config --cxx` -o demo_1 demo_1.cxx -std=c++14 -O2

Thanks! But still seems to have a problem finding libs:

root-config --cxx -o demo_1 demo_1.cxx -std=c++14 -O2
demo_1.cxx:1:10: fatal error: ‘TF1.h’ file not found
1 | #include “TF1.h”
| ^~~~~~~

looks like it wants c++17?

yes you can change to 17.
did you run source $ROOTSYS/bin/thisroot.sh ? I guess yes because you said ROOT is working. In that case it is weird that the include files are not found.

yes, you can see the path in the examples above, so it seems strange to me, Do not remember such problems in previous versions, but I didn’t do it for some time…

It works for me, but I am not exactly in the same condition:

  • I am using the Xcode command line tools
  • I do not use brew
  • I compile ROOT myself.