In this simple program count.c,
#include<stdio.h> int main(int argc,char *argv[]) { int c,i; i=0; while((c=getchar()) != EOF ) { if(c=='/n') ++i; } printf("%d/n",i); }
- The terminal shows "linker input file unused because linking not done" When i compile the program with "gcc -Wall -c count count.c" . And i execute the program count, "Ctrl+D" will not work. And later i know that the option -c is wrong.
-
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
Code: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. - The result, i got two question , "EOF" signal in uinx is "Ctrl+D" and www.unix.com . Thanks.