[Mingw-users] Link problems

Back to archive index
Eli Zaretskii eliz****@gnu*****
Sun May 31 23:51:59 JST 2020


> From: Peter Williams <petes****@gmail*****>
> Date: Sun, 31 May 2020 11:17:46 +0100
> 
> gcc -c -I C:\plplot32\include\plplot x03.c
> gcc -o x03.exe x03.o C:\plplot32\lib\libcsirocsa.a  C:\plplot32\lib\libplplot.a C:\plplot32\lib\libqsastime.a
> -mconsole -mwindows -lm

Why are you using both -mconsole and -mwindows?  Don't they contradict
each other?

> c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe:
> c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../libmingw32.a(mbrscan.o):(.text+0xb6): undefined reference to
> `SetLastError at 4'
> c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe:
> c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../libmingw32.a(wcharmap.o):(.text+0x208): undefined reference to
> `WideCharToMultiByte at 32'

These look like either missing import libraries on the link command
line, or maybe some snafu with including windows.h, which declares
these functions.  The former problem could have been caused by the
fact that you used both -mconsole and -mwindows.  I suggest to add -v
to the GCC command line and see which libraries it scans.



More information about the MinGW-Users mailing list
Back to archive index