c - 使用#include <>时如何修改.h文件的路径?

标签 c gcc

当我们在linux平台上使用#include 时,编译器会在/usr/include中搜索stdio.h。如何改变使用#include<>的路径? 谢谢。

我问这个问题是因为:当我使用C标准函数isdigit()时,如果没有添加“#include”,程序会产生警告但没有错误。但是如果加上"#include ",链接的时候会报错。(我的编译器不是标准的gcc。)

我想知道为什么?

最佳答案

 -I dir
     Add the directory dir to the list of directories to be
     searched for header files.  Directories named by -I are
     searched before the standard system include directories.

关于c - 使用#include <>时如何修改.h文件的路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8050425/

相关文章:

c - 警告 C4047 : '=' : 'char' differs in levels of indirection from 'char [2]'

c - 如何使用链接器将目标文件转换为可执行文件(C 目标文件)

c++ - 为什么未初始化的 constexpr 变量不是常量?

c++ - C 文件中是否需要 extern "C"? (解决奇怪的 Eclipse 行为)

C通过函数传递值会更改函数中的值

c++ - 通过 C 绑定(bind)公开 C++ 库

C预处理器: expand macro in a #warning

c++ - 使用 GCC 强制执行显式(直接)#include 语句

c - 不含数组的结构体的生命周期

C malloc 没有按我预期的方式工作