Linking
Peter Williams <[email protected]> Tue, 2 Jun 2020 12:01:55 +0100
| Newsgroups | gmane.comp.gnu.mingw.user |
|---|---|
| Message-ID | <CANt1qAH3_yu+ESM8PpzBsGHa6vqZAJEegF+zCkJeZsCnh2-nuA@mail.gmail.com> |
Hi Keith and Eli Thank you for your help. I will certainly avoid mingwrt-5.3.1, and avoid libmingwex-2.dll like the plague, or at least like covid19. That done I am still unsure about your comment on my link command: gcc -o x03.exe x03.o C:\plplot32\lib\libcsirocsa.a C:\plplot32\lib\ libplplot.a C:\plplot32\lib\libqsastime.a -mconsole -mwindows -lm It produces: C:\Pete\PlPXmpl>x03.exe Plotting Options: < 1> wingcc Win32 GCC device < 2> ps PostScript File (monochrome) < 3> psc PostScript File (color) < 4> xfig Xfig file < 5> null Null device < 6> mem User-supplied memory device < 7> svg Scalable Vector Graphics (SVG 1.1) Enter device number or keyword: 2 Enter graphics output file name: x03.ps C:\Pete\PlPXmpl> and a lovely graphics picture in x03.ps. No error messages. What's not to like? Would you like to see it? If I omit the -mwindows part I get, not surprisingly a set of error messages: C:\Pete\PlPXmpl>gcc -o x03.exe x03.o C:\plplot32\lib\libcsirocsa.a C:\plplot32\lib\libplplot.a C:\plplot32\lib\libqsastime.a -mconsole -lm c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x316): undefined reference to `SetBkColor@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x36f): undefined reference to `ExtTextOutA@32' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x38d): undefined reference to `SetBkColor@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x405): undefined reference to `SelectObject@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x493): undefined reference to `BitBlt@36' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x4b4): undefined reference to `SelectObject@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x6e3): undefined reference to `SetBkColor@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x73c): undefined reference to `ExtTextOutA@32' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x75a): undefined reference to `SetBkColor@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0xc1d): undefined reference to `GetDeviceCaps@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0xc3b): undefined reference to `GetDeviceCaps@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0xc6f): undefined reference to `GetDeviceCaps@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0xc8d): undefined reference to `GetDeviceCaps@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0xe5e): undefined reference to `SetPolyFillMode@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0xe7c): undefined reference to `SetPolyFillMode@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0xf5f): undefined reference to `SelectObject@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0xfa1): undefined reference to `Polyline@12' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0xfcf): undefined reference to `SetPixel@16' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0xff0): undefined reference to `SelectObject@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1107): undefined reference to `SelectObject@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1134): undefined reference to `Polyline@12' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1155): undefined reference to `SelectObject@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x129d): undefined reference to `CreateSolidBrush@4' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x12c9): undefined reference to `CreatePen@12' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x12ed): undefined reference to `SelectObject@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1313): undefined reference to `SelectObject@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x133e): undefined reference to `Polygon@12' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x135f): undefined reference to `SelectObject@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1373): undefined reference to `DeleteObject@4' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x138e): undefined reference to `SelectObject@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x139c): undefined reference to `DeleteObject@4' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x13e1): undefined reference to `DeleteDC@4' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1402): undefined reference to `DeleteObject@4' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1416): undefined reference to `CreateCompatibleDC@4' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x146d): undefined reference to `CreateCompatibleBitmap@12' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1499): undefined reference to `SelectObject@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1507): undefined reference to `BitBlt@36' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1528): undefined reference to `SelectObject@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x17d0): undefined reference to `DeleteDC@4' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x181c): undefined reference to `DeleteObject@4' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1bd9): undefined reference to `DeleteObject@4' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1c18): undefined reference to `CreatePen@12' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1e82): undefined reference to `SetROP2@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x1ea0): undefined reference to `SetROP2@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x222f): undefined reference to `GetDeviceCaps@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x2253): undefined reference to `GetDeviceCaps@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x22f9): undefined reference to `GetDeviceCaps@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x2317): undefined reference to `GetDeviceCaps@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x2351): undefined reference to `GetDeviceCaps@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x236f): more undefined references to `GetDeviceCaps@8' follow c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x24b9): undefined reference to `PrintDlgA@4' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x25be): undefined reference to `StartDocA@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\plplot32\lib\libplplot.a(wingcc.c.obj):wingcc.c:(.text+0x25dd): undefined reference to `EndDoc@4' collect2.exe: error: ld returned 1 exit status While if I omit the -mconsole part, I get: C:\Pete\PlPXmpl>gcc -o x03.exe x03.o C:\plplot32\lib\libcsirocsa.a C:\plplot32\lib\libplplot.a C:\plplot32\lib\libqsastime.a -mwindows -lm C:\Pete\PlPXmpl>x03.exe C:\Pete\PlPXmpl> Indeed no contradiction, no error messages but no interaction and NO graphics. So in view of your comments I obviously need your help. What would you suggest I write for my linking command? The pair of commands -mconsole -mwindows was suggested in a help text when I first started to use plplot back in the mists of time. Unfortunately I can't find it now but it seems to have been working ok for a long time. Also, perhaps you could give a reference to these Windows commands (presumably they are system .dll's) as I cannot find any specs for them. Best Wishes, Peter Williams -- Peter Williams [email protected] _______________________________________________ MinGW-Users mailing list [email protected] This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. 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=unsubscribe