I'm trying to migrate the MinGW compiler suite from 32 bits to 64. My application has run under 32-bit MinGW for several years. I installed MinGW-w64 in Late November. The program versions are C:\wba\sd>gcc --version gcc (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 8.1.0 C:\wba\sd>ld --version GNU ld (GNU Binutils) 2.30
My program has consisted of a small console app and small Windows app, with a large dll that they link to. This stuff has all worked for several years on my Windows XP Service Pack 3 laptop.
I have used static linking to the various system services, because of problems I've had in the past. The relevant makefile stuff is
CC = g++ -static-libgcc -static-libstdc++
libsdlib.a: sdlib.dll sdmain.o
sdlib.dll: sdmain.o
$(CC) -shared -o sdlib.dll -Wl,--out-implib,libsdlib.a sdmain.o
strip sdlib.dll
sdtty.exe: libsdlib.a sdlib.dll sdui-tty.o
$(CC) -mconsole -o $@ sdui-tty.o -L. -lsdlib
strip sdtty.exe
But the program now fails if it doesn't have access to libwinpthread-1.dll When I'm set up for compilation, that's in the path. Specifically, it's in C:\Program Files\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin\libwinpthread-1.dll But it isn't on the customers' computers. I also have C:\Program Files\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\i686-w64-mingw32\lib\libpthread.a and C:\Program Files\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\i686-w64-mingw32\lib\libpthread.dll.a My attempts to produce the right incantation to get this statically liked into my program have been unsuccessful. I'm a bit rusty on all this. Can anyone help?