Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set priority of conflicting headers c++

Imagine you have two something.h in two different directories. You cannot write to those directories and do not have root access.

You have code that does :

#include <something.h>

How do you specify use the something.h in a specific directory and ignore the other ?

like image 575
madreblu Avatar asked Oct 22 '22 21:10

madreblu


1 Answers

try using:
#include "../directory/something.h"
Note that GCC looks for headers using the Search Path.
You can also ask GCC to look for header files in specified directories. Use -iquote dir, to add the directory dir to the head of the list of directories to be searched for header files.

like image 61
bane Avatar answered Oct 24 '22 15:10

bane