Re: gcc-10: options order important?

2021-09-03 Thread Sven Joachim
On 2021-09-03 12:24 +0200, Piotr A. Dybczyński wrote: > Hi, > > in contrary to previous versions, now in Debian 11 with gcc-10: > > gcc aa.c -lm -o aa works, but > > gcc -lm aa.c -o aa does not work, saying: > > /usr/bin/ld: /tmp/ccWyhudO.o: in function `main': >

Re: gcc-10: options order important?

2021-09-03 Thread tomas
On Fri, Sep 03, 2021 at 12:59:27PM -0400, Greg Wooledge wrote: > On Fri, Sep 03, 2021 at 02:12:46PM +0100, Tixy wrote: > > > A man page a found online [1] says linking happens as Greg described, > > > and this is true looking at a 6 year old copy of that page on > > > archive.org. So seems

Re: gcc-10: options order important?

2021-09-03 Thread Greg Wooledge
On Fri, Sep 03, 2021 at 02:12:46PM +0100, Tixy wrote: > > A man page a found online [1] says linking happens as Greg described, > > and this is true looking at a 6 year old copy of that page on > > archive.org. So seems strange that for many years my Makefiles have > > worked with Libraries

Re: gcc-10: options order important?

2021-09-03 Thread Tixy
On Fri, 2021-09-03 at 14:10 +0100, Tixy wrote: > On Fri, 2021-09-03 at 12:24 +0200, Piotr A. Dybczyński wrote: > > Hi, > > > > in contrary to previous versions, now in Debian 11 with gcc-10: > > > > gcc aa.c -lm -o aa works, but > > > > gcc -lm aa.c -o aa does not work,

Re: gcc-10: options order important?

2021-09-03 Thread Tixy
On Fri, 2021-09-03 at 12:24 +0200, Piotr A. Dybczyński wrote: > Hi, > > in contrary to previous versions, now in Debian 11 with gcc-10: > > gcc aa.c -lm -o aa works, but > > gcc -lm aa.c -o aa does not work, saying: [...] > It seems that an option -lm cannot be placed in

Re: gcc-10: options order important?

2021-09-03 Thread Greg Wooledge
On Fri, Sep 03, 2021 at 12:24:39PM +0200, Piotr A. Dybczyński wrote: > Hi, > > in contrary to previous versions, now in Debian 11 with gcc-10: > > gcc aa.c -lm -o aa works, but > > gcc -lm aa.c -o aa does not work, saying: > > /usr/bin/ld: /tmp/ccWyhudO.o: in function

gcc-10: options order important?

2021-09-03 Thread Piotr A. Dybczyński
Hi, in contrary to previous versions, now in Debian 11 with gcc-10: gcc aa.c -lm -o aa works, but gcc -lm aa.c -o aa does not work, saying: /usr/bin/ld: /tmp/ccWyhudO.o: in function `main': aa.c:(.text+0x1f): undefined reference to `sqrt' collect2: error: ld returned 1