Ubuntu – How to make new header files available universally

compilingfilespermissions

I just downloaded some new header files and have a folder of them that I wish to make available. First, I would like to make them available to any file wishing to use them. So, I would like to be able to include the new header file (call it newheader.h) where I want, just like math.h, for example. Where should I put it?

Second, I wish to make these files available to all users. I have root permissions. Is there a special directory I need to put it in? Thanks so much!

Best Answer

Store them in /usr/local/include. From http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/usr.html, items in this directory are "... safe from being overwritten when the system software is updated", which is important since you do not want the headers files you have downloaded to get clobbered by system updates, which might happen if you put them in /usr/include.

Related Question