c++ - Include file on different compilers
问题描述
Will
#include "filename"
always search for a file in standard include directory if not found in the current directory or for some compilers may not?
Is it possible to turn off searching for the file in standard include directories using this directive for example for gcc?
解决方案
§[cpp.incluce]/2:
形式的预处理指令
# 包含“ q-char-sequence ” 换行符
导致将该指令替换为由 " 分隔符之间的指定序列标识的源文件的全部内容。以实现定义的方式搜索命名的源文件。如果不支持此搜索,或者搜索失败, 该指令被重新处理,就好像它读取
# 包含 < h-char-sequence > 换行符
与原始指令中相同的包含序列(包括>字符,如果有的话)。
...所以是的,如果它没有找到它,它总是在标准包含目录中重新搜索。
推荐阅读
- spring - Spring Swagger,隐藏枚举常量
- android - Android:AEAD 密码的 CipherStream-API 速度不可接受
- azure - Azure 应用服务中的 LDAP 身份验证失败
- javascript - JS Dom 操作问题
- azure - Azure 事件中心防火墙确实为空设置允许一切连接
- javascript - 禁用用户名和密码的chrome自动填充不适用于较新版本
- javascript - 尝试在不使用 eval() 的情况下在 React 中构建通用表单组件
- apache-kafka - debezium - 更改主题名称会导致错误跨数据库引用
- ios - Apple configurator 2 无法安装应用程序
- javascript - this.props.onFetchEventDetail 不是 React js 中的函数