# Header files for GEANT4 application

**URL:** <https://root-forum.cern.ch/t/header-files-for-geant4-application/47711>\
**Category:** Newbie\
**Created:** [November 17, 2021, 9:56pm UTC](https://root-forum.cern.ch/t/header-files-for-geant4-application/47711 "2021-11-17T21:56:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cwoolfo1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/cwoolfo1/32/27915_2.png) [@cwoolfo1](https://root-forum.cern.ch/u/cwoolfo1)\
**Post date:** [November 17, 2021, 9:56pm UTC](https://root-forum.cern.ch/t/header-files-for-geant4-application/47711/1 "2021-11-17T21:56:05Z")

</div>

Hello, I am running GEANT4 with root and am having some issues resolving an error. I have specified the path of the root library for GEANT4 but I am getting the following errors when I make my sim:

fatal error: TString.h: No such file or directory  
11 | #include “TString.h”

* * *

I have read up on this error and I believe that Cmake cannot find the header files for root.

This is the root portion of my CMakeLists.txt file:

#Set up ROOT  
find\_package(ROOT REQUIRED)

#If we found ROOT, add a compile definition (i.e. -DG4ANALYSIS\_USE\_ROOT  
#this will enable compilation the lines between the #ifdef/#endif  
if(ROOT\_FOUND)  
add\_definitions(-DG4ANALYSIS\_USE\_ROOT)  
endif()  
**include\_directories(${ROOT\_INCLUDE\_DIRS}"/home/christopherwoolford/root/cmake")**

* * *

The include directories line was code I have added to try and resolve this issue. I have also tried using the add\_library() method within CMake and several other methods listed in their documentation.

Can any of you offer any advice on solving this issue?

---

<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:** [November 18, 2021, 10:22am UTC](https://root-forum.cern.ch/t/header-files-for-geant4-application/47711/2 "2021-11-18T10:22:35Z")

</div>

To be able to access the ROOT include files it is in principle enough to “source” the file “thisroot.sh” in the bin directory where the root module sits.  
May be GEANT 4 people can also help ?
