include - Does gcc search CPATH recursively? -
on linux system, gcc recursively search path declared in cpath environment variable, or need specify every includes sub-directory explicitly?
cpath specifies list of directories search. compiler searches directories, not sub-directories (so no recursive searching). is, given name #include "somedir/header.h", in directories specified via -i , -isystem , specified via cpath , add /somedir/header.h each of entries — , that's all.
this reasonable. if did recursive searching, you'd have worry getting order right files such <time.h> (because there's <sys/time.h> , might found recursive search).
Comments
Post a Comment