PDA

View Full Version : can't compile with gcc: can't find <stdio.h>



zenc
03-14-2007, 06:03 PM
On my VPS site I'm trying to use gcc but I can't even compile a hello world program:
#include <stdio.h>

main(){
printf("Hello World\n");
}
if I try to compile I get:

gcc helloWorld.c
helloWorld.c:1:19: stdio.h: No such file or directory

but if I execute:
gcc -print-search-dirs I get:
install: /usr/lib/gcc-lib/i386-redhat-linux/2.96/

programs: =/usr/lib/gcc-lib/i386-redhat-linux/2.96/:
/usr/lib/gcc-lib/i386-redhat-linux/2.96/:
/usr/lib/gcc-lib/i386-redhat-linux/:
/usr/lib/gcc/i386-redhat-linux/2.96/:
/usr/lib/gcc/i386-redhat-linux/:
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../../i386-redhat-linux/bin/i386-redhat-linux/2.96/:
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../../i386-redhat-linux/bin/

libraries: =/usr/lib/gcc-lib/i386-redhat-linux/2.96/:
/usr/lib/gcc/i386-redhat-linux/2.96/:
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../../i386-redhat-linux/lib/i386-redhat-linux/2.96/:
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../../i386-redhat-linux/lib/:
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../i386-redhat-linux/2.96/:
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../:
/lib/i386-redhat-linux/2.96/:
/lib/:
/usr/lib/i386-redhat-linux/2.96/:
/usr/lib/

This may be proper, I don't know where the usual include files should be but I notice there are no gcc related files in /usr/libexec, unlike on my fedora core 4 system at home.

Since they provide gcc I assume it normally works and I'm making a naive mistake, can anyone help?

torrin
03-14-2007, 08:51 PM
It's in /usr/include. If it's not there, go into the site manager and uninstall and reinstall the gnu compiler collection. If it's still not there after that, you should contact support.