Error: no include the search path stdio.h

I could compile C programs before, but now I can’t:

$ 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

Yes, I have /usr/include/stdio.h. Yes, build-essentialsinstalled.

This problem started after I modified mine ~/.bashrcto run the program installed in my user directory. I know this is wrong, because if I delete ~/.bashrc, it will work.

Which environment variable will be obscured /usr/includeas an inclusion path?

+3
source share
1 answer

The problem was that I had another GCC in my PATH:

$ which gcc
/home/joey/gcc4ti/bin/gcc

"Hello World", 68000, : D

~/.bashrc:

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

, gcc in /home/joey/gcc4ti/bin. :

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

Source: https://habr.com/ru/post/1776047/


All Articles