Friday, November 6, 2015

Re: Impossible to compile a C source program

On Fri, Nov 6, 2015 at 9:57 AM, aubertin.sylvain
<aubertin.sylvain@sfr.fr> wrote:
> THE WARNING I RECEIVE make: Dépendance circulaire ins <- ins.o abandonnée.
> gcc -c ins ins.o

The above line means:
gcc -c "compile only, don't link"
ins "use ins as input"
ins.o "use ins.o as input"

I suppose you ought to do one of the following:

gcc -c -o ins.o ins.c
compile ins.c, don't link, output to ins.o

gcc -o ins ins.o
link the compiler output ins.o, output to executable ins

gcc -o ins ins.c
compile and link ins.c, output to executable ins

> gcc: warning: ins: linker input file unused because linking not done
> gcc: warning: ins.o: linker input file unused because linking not done
> THE BOTTOM OF THE MAKEFILE
> tri.o: tri
> /bin/bash tri tri.o
> ins.o : ins
> gcc -c ins ins.o
> THE TOP OF MY SOURCE CODE
> ---- a/ins
> +++ b/ins
> #ins
> I changed many times the name of the compiler without any succss The. Error is either on the top of my code named « ins », or in the name of the compiler, at the bottom of the makefile.
> May I have some help. Thanks a lot


A C program source should have a name ending in .c (for a program) or
.h (for a header). So the tules for tri.o and ins.o are upside-down: I
would expect tri and ins to be executables, not sources.

See
man gcc


Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: