简体   繁体   English

如何在C预处理器中包含多个目录以搜索头文件

[英]How to include multiple directories to search header files in C preprocessor

I am using cpp -Idir_name command to preprocess the source file. 我正在使用cpp -Idir_name命令预处理源文件。 In dir_name I have header files included that need to be used for preprocessing. dir_name我包含了需要用于预处理的头文件。

I want to add multiple directories that can be searched for header files. 我想添加可以搜索头文件的多个目录。 How can i do this? 我怎样才能做到这一点?

您可以有多个-I指令,例如

cpp -Ifoo/bar -Ifoo/blech -I../baz ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM