c – – 我与系统目录相对应

前端之家收集整理的这篇文章主要介绍了c – – 我与系统目录相对应前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如果我想要包括搜索文件的目录,哪个是首选方式,为什么?

解决方法

gcc documentation for -I

Add the directory dir to the head of the list of directories to be searched for header files. This can be used to override a system header file,substituting your own version,since these directories are searched before the system header file directories. However,you should not use this option to add directories that contain vendor-supplied system header files (use -isystem for that). If you use more than one -I option,the directories are scanned in left-to-right order; the standard system directories come after.

If a standard system include directory,or a directory specified with -isystem,is also specified with -I,the -I option will be ignored. The directory will still be searched but as a system directory at its normal position in the system include chain. This is to ensure that GCC’s procedure to fix buggy system headers and the ordering for the include_next directive are not inadvertently changed. If you really need to change the search order for system directories,use the -nostdinc and/or -isystem options.

所以,除了特殊情况(如供应商提供的系统头),我可能是指定头文件位置的首选方法.

原文链接:https://www.f2er.com/c/112254.html

猜你在找的C&C++相关文章