#include头文件搜索的路径

C++中的#include指令用于将其他文件内容插入到源代码中。对于双引号引用的文件,搜索顺序是:1) 当前文件夹;2) 已打开的include文件的文件夹(按逆序);3) 编译器设置的include路径;4) 系统的INCLUDE环境变量。而尖括号引用的文件,搜索顺序是:1) 编译器设置的include路径;2) 系统的INCLUDE环境变量。绝对路径的文件会直接按路径查找。
摘要由CSDN通过智能技术生成

The #include directive tells the preprocessor to treat the contents of a specified file as if those contents had appeared in the source program at the point where the directive appears.

 

Syntax Form

Action

Quoted form

The preprocessor searches for include files in the following order:

  1. In the same directory as the file that contains the #include statement.

  2. In the directories of any previously opened include files in the reverse order in which they were opened. The search starts from the directory of the include file that was opened last and continues through the directory of the include file that was opened first.

  3. Along the path specified by each /I compiler option.

  4. Along the paths specified by the INCLUDE environment variable.

Angle-bracket form

The preprocessor

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值