clang : 3.4 : compiling simple c89 programs : unable to find stdio.h


sorry about harranging the list with trivial stuff such as this, but, i
tried to go step by step and wrote the simplest of c programs, the usual
"hello, world!".

#include <stdio.h>

int main(void) {
  printf("Hello, World!\n");

  return 0;

while compiling it using "clang hello.c", it gave the following error;
hello.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
1 error generated.

as a response, i installed 'libclang-3.4-dev' but it still gave the same
error message.

may i know which other libraries i need to install?
at the moment, only for c89 code (i'll approach objc 2 later).



This is not a clang question, it's a question about whatever your operating system is. On FreeBSD, for example, these files are installed by default. On OS X they're installed when you install the XCode command-line tools. Without knowing what your OS is, no one can help you...


david, and the list, i'm really sorry about posing an incomplete query.

i am running ubuntu server 13.10 on my x86-64 with 4gb of system memory.
may i know which libraries i need to install other than libclang-3.4-dev for clang-3.4 to get an environment for c89 development?



'apt-get install build-essential' should install the required C and
C++ library headers (but it might install more than the bare minimum
for your usecase).

thanks dimitri, will definitely look into it.

also, thanks to david chisnall for pointing out that freebsd 10 has all that stuff with the base install, going that way would make my life a lot simpler... :slight_smile:

thanks again,


fwiw, /usr/include/stdio.h is a part of libc6-dev package in debian based