On Wed, 17 May 2023 at 19:45, Ghori, Asif [US] (AS) via Gcc-help <gcc-help@xxxxxxxxxxx> wrote: > > Hi > In our cmake file, We have included the directory (for example util) but would like to exclude file named (utilities.h) as we would like to use > Utilities.h in a different directory. utilities.h and Utilities.h are different files, so I hope that's just a typo. > I have tried different gcc options such as -I or -iquote to direct the included files from a secondary directory. Upon compilation, it still points to the util directory. > We are using gcc 4.8.5, please let me know if newer version have some features or options that I can use to exclude certain files from util directory (which will force it to use second location) > Or is there a flag making gcc not use the current directory of the include file. Use #include <utilities.h> instead of #include "utilities.h" https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html > I have seen some examples where user defined files were used instead of standard directory using -I- or -iquote etc > > For example: > > A.cpp - "include "/util/B.h" > > B.h has include "C_util.h" > > Directory util has C_util.h - which is the current directory for gcc. Also Second_Dir has C_util.h. > > I would like B.h to use C_util.h from Second_Dir instead of directory util. > How to make gcc not use the current directory from the included file. > > Thanks > > Asif