Find where C/C++ headers are in Linux

April 17, 2020


Here's a tip on how to find the correct path for setting the include directory.


When working on large C/C++ projects it can be difficult to tell where a given header is coming from, it's hard to search for this as answers found on search engines are usually specific to some project.


So how can you find where C/C++ headers are? Or which package should you include to get a specific header?


Simple, just use:


locate glx.h


Unlike find it doesn't search in realtime but it uses a database (from updatedb) so it's much faster.