The include path

Hi, I am new here, and I just couldn’t manage to solve this simple problem.

For root 5.35 with mac os x, what is the path used to grab the header files in root/include/ ?
I know if I put every header file into root/include/root/ or simply root/, then everything work fine, but I just don’t feel comfortable without making it read in root/include/something_else/.

And I checked that the PATH is not CPLUS_INCLUDE_PATH, and it was not declared anywhere in

Thanks for helping.

You can and should use root-config --incdir to query the path where ROOT headers are installed (e.g. in your Makefiles). That way changing ROOT versions will give you less headaches that manually keeping track of environment variables.

Okay, root-config actually is sort of like a memorandum of what had been done by configure. Changing any variables inside does not necessarily change the $PATH.
However, if I actually wish to change $incdir, I will have to modify configure, which I feel like it’s disrespectful to the developers.
In future though, I hope the PATH, such as incdir, can be recursively applied to all its subdirectory if it is yet so. Having all the header files sitting together in one directory make it kind of messy.


By the way, just an extra thing.
For some reason, under root interface,
still work when I deleted the include file.

This is odd, but probably not too important.

I don’t get your point. You want to know where the headers for your currently active ROOT version are located. You switch versions with

which adjusts among other things the PATH environment variable (that’s a colon-separated list of directories which are examined when trying to execute a binary without path, not a compiler include path).

Then running

$ root-config --incdir

will tell you exactly where the headers are installed since the correct root-config executable is picked up from the PATH adjusted by Of course this file was created by ./configure which knows how you installed ROOT, and there is absolutely zero reason for you to edit or customize root-config.

Once you run ROOT loading of libraries in the interpreter has nothing to do with the include path. ROOT dictionaries carry dictionary information so signatures are known to the interpreter (i.e. it usually doesn’t rely on headers). That library loading is unaffected by the include path (and even less your shell’s PATH) is not odd at all.

I think the thing is that only set the main PATH to root, so that by typing root it would open.

But I am trying to insert a new file and making it available on root by
which need DYLC_LIBARAY_PATH and CPLUS_INCLUDE_PATH(actually I don’t think which path root used) to access root/lib and root/include while root is running. I don’t think can change libdir(for .so and .rootmap files) or incdir (for .h or .hh files). I think can only change PATH.
Well, maybe it can, I am not sure.

However, even if I store everything accordingly (that is within libdir and incdir), I still get problems. I guess I will post a new post if I cannot find it else where.

I think you are confused about what header files and library files are (even more clear in your new question). A header file is a text file that defines some functions or classes (see e.g. $ROOTSYS/include/TH1.h for an example), while a library is a binary file produced by a compiler from source files (typically headers and sources. The library produced from the source file TH1.cxx is $ROOTSYS/lib/

Hmm, I see, does that mean I am missing the source files (to be stored in macros perhaps)?