Re: Program links with GCC 4.7.2 and not GCC 9.2.0

Roy Qu <[email protected]> Wed, 16 Dec 2020 08:14:49 +0800
Newsgroups gmane.comp.gnu.mingw.user
Message-ID <CAKjWZNWsSnCAMvxn5xxK1TezdgifHVcTnoQa_5aDjmvQHdFLhA@mail.gmail.com>
--===============0505339003863833431==
Content-Type: multipart/alternative; boundary="000000000000148c6605b689c473"

--000000000000148c6605b689c473
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I think you should rebuild  wsc32.lib with gcc 9.2 first.
It seems that c++ libs build with gcc 4.7 are not binary compatible with
gcc 9.2.


Bob Paddock <[email protected]> =E4=BA=8E2020=E5=B9=B412=E6=9C=8815=
=E6=97=A5=E5=91=A8=E4=BA=8C =E4=B8=8B=E5=8D=889:38=E5=86=99=E9=81=93=EF=BC=
=9A

> I need to update a program that I last touched in ~2013.
> When I use MinGW GCC 4.7.2 from that era the program links and runs
> fine.
>
> When I try to use MinGW GCC 9.2.0 I get 'undefined reference' while
> linking to an external
> library, that links just fine with 4.7.2.
>
> Would someone be so kind as to tell me what changed between these two
> versions of the compiler and how I need to fix it?
>
> Works fine:
>
> gcc --version
> gcc (GCC) 4.7.2
> Copyright (C) 2012 Free Software Foundation, Inc.
>
> make -f version(lib)32._G_
> gcc -c -Wall Version.c
> gcc -o Version.exe Version.o wsc32.lib -s -lcomctl32 -lgdi32
>
> Won't link:
>
> gcc --version
> gcc (GCC) 9.2.0
> Copyright (C) 2019 Free Software Foundation, Inc.
>
> gcc -c -Wall Version.c
> gcc -o Version.exe Version.o wsc32.lib -s -lcomctl32 -lgdi32
>
> [snipped long lines and multiple 'undefined reference']
>
> ../x86_64-w64-mingw32/bin/ld.exe: Version.o:Version.c:
>
> (.text+0xf0): undefined reference to `__imp_SioInfo'
> collect2.exe: error: ld returned 1 exit status
>
> _______________________________________________
> MinGW-Users mailing list
> [email protected]
>
> This list observes the Posting Etiquette, as described at
> https://mingw.osdn.io/index.html?page=3Dmailing.html#list-etiquette.
> We ask that you be polite and do the same.  Disregard for the list
> etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.osdn.me/mailman/listinfo/mingw-users
> Also: mailto:[email protected]?subject=3Dunsubscribe

--000000000000148c6605b689c473
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I think you should rebuild=C2=A0

wsc32.lib with gcc 9.2 first.<div>It seems that c++ libs build with gcc 4.7=
 are not binary compatible with gcc 9.2.=C2=A0<br><div><br></div></div></di=
v><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">Bob =
Paddock &lt;<a href=3D"mailto:[email protected]">graceindustries@gm=
ail.com</a>&gt; =E4=BA=8E2020=E5=B9=B412=E6=9C=8815=E6=97=A5=E5=91=A8=E4=BA=
=8C =E4=B8=8B=E5=8D=889:38=E5=86=99=E9=81=93=EF=BC=9A<br></div><blockquote =
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex">I need to update a program that I las=
t touched in ~2013.<br>
When I use MinGW GCC 4.7.2 from that era the program links and runs<br>
fine.<br>
<br>
When I try to use MinGW GCC 9.2.0 I get &#39;undefined reference&#39; while=
<br>
linking to an external<br>
library, that links just fine with 4.7.2.<br>
<br>
Would someone be so kind as to tell me what changed between these two<br>
versions of the compiler and how I need to fix it?<br>
<br>
Works fine:<br>
<br>
gcc --version<br>
gcc (GCC) 4.7.2<br>
Copyright (C) 2012 Free Software Foundation, Inc.<br>
<br>
make -f version(lib)32._G_<br>
gcc -c -Wall Version.c<br>
gcc -o Version.exe Version.o wsc32.lib -s -lcomctl32 -lgdi32<br>
<br>
Won&#39;t link:<br>
<br>
gcc --version<br>
gcc (GCC) 9.2.0<br>
Copyright (C) 2019 Free Software Foundation, Inc.<br>
<br>
gcc -c -Wall Version.c<br>
gcc -o Version.exe Version.o wsc32.lib -s -lcomctl32 -lgdi32<br>
<br>
[snipped long lines and multiple &#39;undefined reference&#39;]<br>
<br>
../x86_64-w64-mingw32/bin/ld.exe: Version.o:Version.c:<br>
<br>
(.text+0xf0): undefined reference to `__imp_SioInfo&#39;<br>
collect2.exe: error: ld returned 1 exit status<br>
<br>
_______________________________________________<br>
MinGW-Users mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">MinGW-Users@=
lists.osdn.me</a><br>
<br>
This list observes the Posting Etiquette, as described at <a href=3D"https:=
//mingw.osdn.io/index.html?page=3Dmailing.html#list-etiquette" rel=3D"noref=
errer" target=3D"_blank">https://mingw.osdn.io/index.html?page=3Dmailing.ht=
ml#list-etiquette</a>.<br>
We ask that you be polite and do the same.=C2=A0 Disregard for the list eti=
quette may cause your account to be moderated.<br>
<br>
_______________________________________________<br>
You may change your MinGW Account Options or unsubscribe at:<br>
<a href=3D"https://lists.osdn.me/mailman/listinfo/mingw-users" rel=3D"noref=
errer" target=3D"_blank">https://lists.osdn.me/mailman/listinfo/mingw-users=
</a><br>
Also: mailto:<a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a>?subject=3Dunsubscribe</block=
quote></div>

--000000000000148c6605b689c473--


--===============0505339003863833431==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTWluR1ctVXNl
cnMgbWFpbGluZyBsaXN0Ck1pbkdXLVVzZXJzQGxpc3RzLm9zZG4ubWUKClRoaXMgbGlzdCBvYnNl
cnZlcyB0aGUgUG9zdGluZyBFdGlxdWV0dGUsIGFzIGRlc2NyaWJlZCBhdCBodHRwczovL21pbmd3
Lm9zZG4uaW8vaW5kZXguaHRtbD9wYWdlPW1haWxpbmcuaHRtbCNsaXN0LWV0aXF1ZXR0ZS4KV2Ug
YXNrIHRoYXQgeW91IGJlIHBvbGl0ZSBhbmQgZG8gdGhlIHNhbWUuICBEaXNyZWdhcmQgZm9yIHRo
ZSBsaXN0IGV0aXF1ZXR0ZSBtYXkgY2F1c2UgeW91ciBhY2NvdW50IHRvIGJlIG1vZGVyYXRlZC4K
Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCllvdSBtYXkg
Y2hhbmdlIHlvdXIgTWluR1cgQWNjb3VudCBPcHRpb25zIG9yIHVuc3Vic2NyaWJlIGF0OgpodHRw
czovL2xpc3RzLm9zZG4ubWUvbWFpbG1hbi9saXN0aW5mby9taW5ndy11c2VycwpBbHNvOiBtYWls
dG86bWluZ3ctdXNlcnMtcmVxdWVzdEBsaXN0cy5vc2RuLm1lP3N1YmplY3Q9dW5zdWJzY3JpYmU=

--===============0505339003863833431==--