# Clang unable to find ROOT headers

**URL:** <https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061>\
**Category:** Newbie\
**Created:** [March 19, 2021, 12:35am UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061 "2021-03-19T00:35:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![al\_bohr](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@al\_bohr](https://root-forum.cern.ch/u/al_bohr)\
**Post date:** [March 19, 2021, 12:35am UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/1 "2021-03-19T00:35:41Z")

</div>

* * *

_ROOT Version:_ 6.22.08  
_Platform:_ MaxOSX 11.2.3 Big Sur  
_Compiler:_ Clang

* * *

Hello!  
Newbie here, I recently installed ROOT via the binary on the site (clang 12 for Xcode 12) and I am able to use it after having set the correct PATH variables. Nevertheless, I can’t compile a c++ program that invokes ROOT libraries because Clang fails in finding the proper headers. As an example I get this message as an error

```auto
Apple clang version 12.0.0 (clang-1200.0.32.29)

Target: x86_64-apple-darwin20.3.0

Thread model: posix

InstalledDir: /Library/Developer/CommandLineTools/usr/bin

ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/v1"

"/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx11.0.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name slyt1.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-strict-return -masm-verbose -munwind-tables -target-sdk-version=11.1 -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 609.8 -v -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -stdlib=libc++ -internal-isystem /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -fdeprecated-macro -fdebug-compilation-dir "/Users/mac 1" -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fobjc-runtime=macosx-11.0.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/_f/2gdjhgp139gcv4gdv2ggp9y00000gp/T/slyt1-9bc1bf.o -x c++ slyt1.cpp

clang -cc1 version 12.0.0 (clang-1200.0.32.29) default target x86_64-apple-darwin20.3.0

ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/local/include"

ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/Library/Frameworks"

#include "..." search starts here:

#include <...> search starts here:

/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1

/Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include

/Library/Developer/CommandLineTools/usr/include

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks (framework directory)

End of search list.

**slyt1.cpp:5:10:**  **fatal error:**  **'TH1F.h' file not found**

#include "TH1F.h"

**^ ~~~~~~~ **

1 error generated.

```

Before posting here, I properly installed Xcode and the command developer tools via

```auto
xcode-select --install

```

I also tried to use g++ as a compiler but of course failed in trying since ROOT uses clang. After some unconclusive research on this forum I believe the problem is in the compiler, since if I launch root from terminal I can use it without any problems. Any idea on how I can fix this?  
Thanks in advance.

---

<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:** [March 19, 2021, 8:10am UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/2 "2021-03-19T08:10:49Z")

</div>

So I suppose you executed the script `thisroot.sh` to define all the environment variables as explained [here](https://root.cern/install/). Also, can you show the command you used to compile ?

---

<div class="post-metadata">

**Author:** ![al\_bohr](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@al\_bohr](https://root-forum.cern.ch/u/al_bohr)\
**Post date:** [March 19, 2021, 12:46pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/3 "2021-03-19T12:46:05Z")

</div>

@couet

Yes, I also defined the environment variables in

```auto
.bashrc

```

In this way I am able to run root from every directory by typing

```auto
(base) Mac-5:~ nicola$ root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.22/08 https://root.cern |
  | (c) 1995-2020, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosx64 on Mar 10 2021, 14:20:04 |
  | From tags/v6-22-08@v6-22-08 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------------

root [0] 

```

The problem is, whenever I write a c++ program and try to compile it like this

```auto
(base) Mac-5:~ nicola$ clang++ -o slyt1 slyt1.cpp $(root-config --libs --cflags)

usage: dirname path

usage: dirname path

**slyt1.cpp:5:10:**  **fatal error:**  **'TH1F.h' file not found**

#include "TH1F.h"

**^ ~~~~~~~ **

1 error generated.

```

I also tried to use different syntax

```auto
(base) Mac-5:~ nicola$ clang++ -o slyt1 slyt1.cpp `root-config --libs --cflags`
usage: dirname path
usage: dirname path
slyt1.cpp:5:10: fatal error: 'TH1F.h' file not found
#include "TH1F.h"
         ^ ~~~~~~~
1 error generated.

```

as suggested in other posts on the forum, but it doesn’t make any difference.

Of course if I try to use g++

```auto
(base) Mac-5:~ nicola$ g++ -o slyt1 slyt1.cpp `root-config --libs --cflags`
usage: dirname path
usage: dirname path
g++-10: error: unrecognized command-line option '-stdlib=libc++'
g++-10: error: unrecognized command-line option '-stdlib=libc++'

```

So what should I do?

Again, by looking at the verbose content of the clang error it seems the compiler doesn’t find ROOT headers:

```auto
usage: dirname path
usage: dirname path
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/v1"
 "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx11.0.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name slyt1.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-strict-return -masm-verbose -munwind-tables -target-sdk-version=11.1 -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 609.8 -v -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I /include -stdlib=libc++ -stdlib=libc++ -internal-isystem /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -std=c++11 -fdeprecated-macro -fdebug-compilation-dir "/Users/mac 1" -ferror-limit 19 -fmessage-length 157 -pthread -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fobjc-runtime=macosx-11.0.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/_f/2gdjhgp139gcv4gdv2ggp9y00000gp/T/slyt1-e283b6.o -x c++ slyt1.cpp
clang -cc1 version 12.0.0 (clang-1200.0.32.29) default target x86_64-apple-darwin20.3.0
ignoring nonexistent directory "/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1
 /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include
 /Library/Developer/CommandLineTools/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks (framework directory)
End of search list.
slyt1.cpp:5:10: fatal error: 'TH1F.h' file not found
#include "TH1F.h"
         ^ ~~~~~~~
1 error generated.

```

Thanks for your help.

---

<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:** [March 19, 2021, 12:52pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/4 "2021-03-19T12:52:19Z")

</div>

Try:

```bash
`root-config --cxx --cflags` -o slyt1 slyt1.cpp `root-config --libs`

```

---

<div class="post-metadata">

**Author:** ![al\_bohr](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@al\_bohr](https://root-forum.cern.ch/u/al_bohr)\
**Post date:** [March 19, 2021, 1:05pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/5 "2021-03-19T13:05:10Z")

</div>

@Wile_E_Coyote

I get the following error:

```auto
(base) Mac-5:~ nicola$ clang++ `root-config --cxx --cflags` -o slyt1 slyt1.cpp `root-config --libs` -v
usage: dirname path
usage: dirname path
usage: dirname path
usage: dirname path
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
clang: error: no such file or directory: 'c++'
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/v1"

```

---

<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:** [March 19, 2021, 1:06pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/6 "2021-03-19T13:06:27Z")

</div>

Where do you see “`clang++`” in my previous post?

---

<div class="post-metadata">

**Author:** ![al\_bohr](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@al\_bohr](https://root-forum.cern.ch/u/al_bohr)\
**Post date:** [March 19, 2021, 1:13pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/7 "2021-03-19T13:13:59Z")

</div>

sorry, but the error is still the same

```auto
(base) Mac-5:~ nicola$ `root-config --cxx --cflags` -o slyt1 slyt1.cpp `root-config --libs` -v
usage: dirname path
usage: dirname path
usage: dirname path
usage: dirname path
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/v1"
"/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx11.0.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name slyt1.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-strict-return -masm-verbose -munwind-tables -target-sdk-version=11.1 -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 609.8 -v -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I /include -stdlib=libc++ -stdlib=libc++ -internal-isystem /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -std=c++11 -fdeprecated-macro -fdebug-compilation-dir "/Users/mac 1" -ferror-limit 19 -fmessage-length 80 -pthread -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fobjc-runtime=macosx-11.0.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/_f/2gdjhgp139gcv4gdv2ggp9y00000gp/T/slyt1-f2c001.o -x c++ slyt1.cpp
clang -cc1 version 12.0.0 (clang-1200.0.32.29) default target x86_64-apple-darwin20.3.0
ignoring nonexistent directory "/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include
/Library/Developer/CommandLineTools/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks (framework directory)
End of search list.
**slyt1.cpp:5:10:**  **fatal error:**  **'TH1F.h' file not found**
#include "TH1F.h"
**^ ~~~~~~~ **
1 error generated.

```

---

<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:** [March 19, 2021, 1:18pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/8 "2021-03-19T13:18:30Z")

</div>

Inspect paths which appear in the output of:

```bash
root-config --incdir # should contain ROOT includes
root-config --cxx --cflags
root-config --libdir # should contain ROOT libraries
root-config --libs

```

---

<div class="post-metadata">

**Author:** ![al\_bohr](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@al\_bohr](https://root-forum.cern.ch/u/al_bohr)\
**Post date:** [March 19, 2021, 1:22pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/9 "2021-03-19T13:22:52Z")

</div>

Indeed, that’s the case:

```auto
(base) Mac-5:~ nicola$ root-config --incdir
usage: dirname path
usage: dirname path
/include
(base) Mac-5:~ nicola$ root-config --cxx --cflags
usage: dirname path
usage: dirname path
c++ -stdlib=libc++ -pthread -std=c++11 -m64 -I/include
(base) Mac-5:~ nicola$ root-config --libdir
usage: dirname path
usage: dirname path
/lib
(base) Mac-5:~ nicola$ root-config --libs
usage: dirname path
usage: dirname path
-L/lib -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -stdlib=libc++ -lpthread -lm -ldl

```

I guess those path are referred to the position of ROOT, right?

---

<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:** [March 19, 2021, 1:29pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/10 "2021-03-19T13:29:32Z")

</div>

To me, the errors “`usage: dirname path`” suggest that your login shell has problems with “`root-config`”.  
Can you try to run “`bash`” and then from inside of it execute “`root-config ...`”.

---

<div class="post-metadata">

**Author:** ![al\_bohr](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@al\_bohr](https://root-forum.cern.ch/u/al_bohr)\
**Post date:** [March 19, 2021, 1:30pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/11 "2021-03-19T13:30:31Z")

</div>

For instance the first path,

```auto
$ROOTSYS/include/

```

contains the

```auto
TH1F.h

```

header, so I guess the problem is not in ROOT

---

<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:** [March 19, 2021, 1:32pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/12 "2021-03-19T13:32:12Z")

</div>

Do they return the same:

```auto
echo ${ROOTSYS}
root-config --prefix

```

---

<div class="post-metadata">

**Author:** ![al\_bohr](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@al\_bohr](https://root-forum.cern.ch/u/al_bohr)\
**Post date:** [March 19, 2021, 1:32pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/13 "2021-03-19T13:32:32Z")

</div>

Unfortunately, same error

```auto
(base) Mac-5:/ nicola$ bash
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
bash-3.2$ `root-config --cxx --cflags` -o slyt1 slyt1.cpp `root-config --libs`
usage: dirname path
usage: dirname path
usage: dirname path
usage: dirname path
slyt1.cpp:5:10: fatal error: 'TH1F.h' file not found
#include "TH1F.h"
         ^ ~~~~~~~
1 error generated.

```

---

<div class="post-metadata">

**Author:** ![al\_bohr](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@al\_bohr](https://root-forum.cern.ch/u/al_bohr)\
**Post date:** [March 19, 2021, 1:34pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/14 "2021-03-19T13:34:23Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> `echo ${ROOTSYS}`

No, they don’t:

```auto
bash-3.2$ echo ${ROOTSYS}
/Users/mac 1/root_v6.22.08
bash-3.2$ root-config --prefix
usage: dirname path
usage: dirname path

```

---

<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:** [March 19, 2021, 1:36pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/15 "2021-03-19T13:36:39Z")

</div>

So, I suspected it was “zsh” … try to run "`bash"` and then:

```bash
export SHELL="/bin/bash" # or maybe /usr/bin/bash
root-config --prefix

```

BTW. Make the “bash” your default login shell, if you want fewer problems with somebody’s scripts.

---

<div class="post-metadata">

**Author:** ![al\_bohr](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@al\_bohr](https://root-forum.cern.ch/u/al_bohr)\
**Post date:** [March 19, 2021, 1:39pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/16 "2021-03-19T13:39:24Z")

</div>

Strange…, here is the output:

```auto
bash-3.2$ export SHELL="/bin/bash"
bash-3.2$ root-config --prefix
usage: dirname path
usage: dirname path

```

---

<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:** [March 19, 2021, 1:39pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/17 "2021-03-19T13:39:34Z")

</div>

One more thing that I now noticed … ROOT is known to trip on paths which contain spaces. Make sure that you do NOT use “`.../mac 1/...`” (maybe this is the origin of the “`usage: dirname path`” errors).

---

<div class="post-metadata">

**Author:** ![al\_bohr](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@al\_bohr](https://root-forum.cern.ch/u/al_bohr)\
**Post date:** [March 19, 2021, 2:06pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/18 "2021-03-19T14:06:40Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> ```auto
> `root-config --cxx --cflags` -o slyt1 slyt1.cpp `root-config --libs`
> 
> ```

This solved the issue, I can’t express how grateful I am

---

<div class="post-metadata">

**Author:** ![al\_bohr](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@al\_bohr](https://root-forum.cern.ch/u/al_bohr)\
**Post date:** [March 19, 2021, 2:07pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/19 "2021-03-19T14:07:14Z")

</div>

after eliminating that space in ‘Mac 1’

---

<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:** [March 19, 2021, 2:09pm UTC](https://root-forum.cern.ch/t/clang-unable-to-find-root-headers/44061/20 "2021-03-19T14:09:29Z")

</div>

Try the various “`root-config --...`” commands from my previous posts and make sure that they return paths consistent with “`echo ${ROOTSYS}`”.
