g++ compile using custom header file
I want to us开发者_JAVA百科e a header file,
its included as #include <custom.h>
how can I compile it by using the custom.h header file ?
I tried -I /path/to/custom.h
, but its giving me error that its not a directory..
-I /path/to
This will enable all headers in that directory to be found.
In man gcc, search (using / in your pager) for "-I dir":
-I dir
Add the directory dir to the list of directories to be searched for header files. Directories named by -I are searched before the standard system include directories. If the directory dir is a standard system include directory, the option is ignored to ensure that the default search order for system directories and the special treatment of system headers are not defeated. If dir begins with "=", then the "=" will be replaced by the sysroot prefix; see --sysroot and -isysroot.
Indeed /path/to/custom.h
is not a directory but a file.
-I/path/to/custom/
精彩评论