I execute the program in Debian. It had no response when input "Ctrl D" and was interrupted when input "Ctrl Z" in terminal. :o How to print the value of i?
Strange, Ctrl+D should have worked. With Ctrl+Z, you've sent the program into the background, suspending its execution, so there won't be any more output (check the output of ps -ef , and you'll see them floating around).
I am not sure exactly what causes this problem. But you can ignore this as you just started with simple programs and not linking any libraries while compiling.
Can you try
gcc -c -Wall -o file file.c
. This command is producing the same error as you posted.
But without option "-c" it works fine for me. (this option stops the compiler from invoking the linker. But you have not mentioned this option but still getting this error seems to odd.