Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 错误:没有要在其中搜索stdio.h的包含路径_C_Linux_Gcc_Bash - Fatal编程技术网

C 错误:没有要在其中搜索stdio.h的包含路径

C 错误:没有要在其中搜索stdio.h的包含路径,c,linux,gcc,bash,C,Linux,Gcc,Bash,我以前能够编译C程序,但现在我不能: $ cat helloworld.c #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } $ gcc helloworld.c helloworld.c:1:19: error: no include path in which to search for stdio.h $cat helloworld.c #包括 内部主(空)

我以前能够编译C程序,但现在我不能:

$ cat helloworld.c
#include <stdio.h>

int main(void)
{
    printf("Hello, world!\n");
    return 0;
}

$ gcc helloworld.c
helloworld.c:1:19: error: no include path in which to search for stdio.h
$cat helloworld.c
#包括
内部主(空)
{
printf(“你好,世界!\n”);
返回0;
}
$gcc helloworld.c
helloworld.c:1:19:错误:没有要在其中搜索stdio.h的包含路径
是的,我有
/usr/include/stdio.h
。是,安装了
build-essentials

这个问题是在我修改了
~/.bashrc
以运行安装在我的用户目录中的程序之后开始的。我知道这是错误的,因为如果我删除
~/.bashrc
,它就会工作


什么环境变量会将
/usr/include
隐藏为包含路径?

问题是我的路径中有另一个GCC:

$ which gcc
/home/joey/gcc4ti/bin/gcc
当我试图编译“Hello World”时,它运行的是68000的编译器,而不是我的系统编译器:D

我的
~/.bashrc
中有这个:

export PATH="/home/joey/gcc4ti/bin:$PATH"
由于路径是按顺序扫描的,因此首先会看到
/home/joey/gcc4ti/bin
中的
gcc
。我把它改成:

export PATH="$PATH:/home/joey/gcc4ti/bin"

粘贴
.bashrc
的内容会很有帮助。