This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Compiled Program has no output
- From: "Larry" <temp at cogeco dot ca>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Sun, 2 Nov 2003 19:59:04 -0500
- Subject: Compiled Program has no output
Hi All!
I am not too familiar with the nuances of gcc and would appreciate any help
any of you can extend with my problem described below.
I have coded up the following program named test.c:
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
fprintf(stderr, "testing 123\n");
exit(0);
}
I tried compiling it using the following commands:
seawolf:~/test% gcc -Wall -c -o test.o test.c
seawolf:~/test% gcc -Wall -o test test.o
I then executed the test program:
seawolf:~/test% test
seawolf:~/test%
I did not get any output.
However, when I tried compiling with the following commands:
seawolf:~/test% gcc -Wall test.c
I then exexecuted the test program:
seawolf:~/test% a.out
testing 123
seawolf:~/test%
Now, I get some output!
Hmm... I don't understand what is going on since I thought the two methods
of compilation I outlined above should be equivalent.
Thanks,
Laurence