11 Replies Latest reply: Jan 18, 2013 4:13 AM by Wesley212
johnfromgilroy Level 1 Level 1 (5 points)

Here's my program, written in vim.

 

#include <stdio.h>

 

 

int main(void)

 

 

{

  printf("Hello world!\n");

  return 0;

}

 

I enter:   gcc hello.c

and I get:

 

hello.c:1:19: error: stdio.h: No such file or directory

hello.c: In function ‘main’:

hello.c:6: warning: incompatible implicit declaration of built-in function ‘printf’

 

Why doesn't this work? and How do I get going to writing programs in C?

 

Thanks,

JfromG


iMac, Mac OS X (10.7.1)