lundi 8 novembre 2021

How to properly alias a system header file for inclusion as

Suppose I've written a header named foo.h, and that foo.h is also the name of one of the headers under /usr/include. Now, in my source files, I want to say #include <foo.h>, but arrange my build so that the compiler will search the directory with my foo.h before /usr/include. It is almost important that users be able to write <foo.h> instead of "foo.h".

How do I arrange this in the C or C++ compiler command-line (e.g. with GCC, clang)?

Aucun commentaire:

Enregistrer un commentaire