If I include the headers(.h files) like
#include "myHeader.h",
in my implementation file(.C file), then 'myHeader.h' is properly
included. But, when I include it like
#include <myHeader.h>, Compiler gives an error.
What setting do I need to do such that, the latter syntax also accepted
for my headers ?
The <...> notation finds headers "in the standard places", hence
system headers, as opposed to those that you provide, will be
found.
The "..." notation probably looks in the current working
directory first, and will thus include headers you provide,
before looking in the same places that <...> will look.
That means you probably want to use the different notations
thusly,
#include <stdio.h> /* header provided by the platform */
#include "myhdr.h> /* header provided by the program */
With unix style compilers you also have the option of adding to
the places the compiler thinks of as "standard", usually with
the -I option. Hence invoking the compiler with '-I./include'
will cause the <...> notation to also look in the ./include
directory for headers.
You'll definitely want to read the documentation for your
compiler. You can also look for an option that will tell you
more about what it is doing. For example, with the GNU C
compiler, gcc, you can give it the -v option and it will
verbosely explain what it is doing and where it is searching for
headers (and libraries, and whatever).