thanks everyone (Christian, Frank)
2013/5/31 Christian Schoenebeck
> On Friday 31 May 2013 13:24:32 Nick Humphrey wrote:
> > what am i doing wrong?
> >
> > cc -c nki.c
>
> -c creates an object file, which is not an executable, but rather an
> intermediary object, which has to be linked to a fin
On Friday 31 May 2013 13:24:32 Nick Humphrey wrote:
> what am i doing wrong?
>
> cc -c nki.c
-c creates an object file, which is not an executable, but rather an
intermediary object, which has to be linked to a final executable.
By leaving off "-c" the compiler will create an executable binary
Hi Nick,
> what am i doing wrong?
>
> cc -c nki.c
>
> chmod +x nki.o
>
> ./nki.o
>
> gives:
> bash: ./nki.o: cannot execute binary file
You are telling the compiler to just build an object file from a source
file ("-c"), but that does not build (link) the final executable.
Instead, try
gcc