Impossible to compile a C source program

893 views
Skip to first unread message

aubertin.sylvain

unread,
Nov 6, 2015, 3:57:42 AM11/6/15
to vim_use
THE WARNING I RECEIVE make: Dépendance circulaire ins <- ins.o abandonnée.
gcc -c ins ins.o
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

Tony Mechelynck

unread,
Nov 6, 2015, 4:53:42 AM11/6/15
to vim...@googlegroups.com
On Fri, Nov 6, 2015 at 9:57 AM, aubertin.sylvain
<aubertin...@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.

aubertin.sylvain

unread,
Nov 6, 2015, 5:44:07 AM11/6/15
to vim_use
I changed the name of my source (ins.c instead of ins) and the first thing I see : all my program became coloured, and the compiler goes on. It is marvellous.Thank you very much.
However there is something I don't understand: he finds many errors. I copied that "insert sort" on the pages of a school. Maybe the compiler does not understand that language. Thanks again

Ben Fritz

unread,
Nov 6, 2015, 10:01:46 AM11/6/15
to vim_use
On Friday, November 6, 2015 at 4:44:07 AM UTC-6, aubertin.sylvain wrote:
>
> I changed the name of my source (ins.c instead of ins) and the first thing I see : all my program became coloured, and the compiler goes on. It is marvellous.Thank you very much.
> However there is something I don't understand: he finds many errors. I copied that "insert sort" on the pages of a school. Maybe the compiler does not understand that language. Thanks again

It looks like you may need to read an "introduction to C" book, or take a class about coding in C, rather than asking about it on a mailing list about how to use a text editor.

This discussion is very off-topic for this list.

Reply all
Reply to author
Forward
0 new messages