I think the main() function thing is
not the actual problem. "void main()" is not the right way, but it actually should only result in a
warning.
Quote:
Originally posted by banana2
debian:/# gcc ctest
/usr/bin/ld: cannot open crt1.o: No such file or directory
collect2: ld returned 1 exit status
|
I think the real problem is the command you are using to compile your program with. It should read: "gcc ctest
.c" at least. After this, the executable file will bee called "a.out" and you should run it with: "./a.out".
Better yet: "gcc ctest.c ctest". Then your executable will be called "ctest", and can run it with "./ctest".
Like bgraur already pointed out, the text inside the printf statement should be quoted with " ". Without these double quotes, compiling will fail anyway.