0

I have an application in C++ that is using Qt framework and I want to cross compile it into a portable program for Windows. Since I don't have any computer or virtual box with Windows operating system (and I also don't have enough space on my disk to change that), I'm trying to use MinGW to cross compile. I've installed MinGW from the ArchLinux packages and the other required libraries from the AUR.

However, everytime I try to compile the program, it would link to api-ms-win-core-winrt-l1-1-0.dll and api-ms-win-core-synch-l1-2-0.dll. Windows users then complain about seeing error messages like

The procedure entry point CreateEventW could not be located in the dynamic link library api-ms-win-core-synch-l1-2-0.dll

or error message

The program can't start because api-ms-win-core-winrt-l1-1-0.dll is missing from your computer

My understanding is that these are windows-internal apis and that I shouldn't be linking to them. Can someone tell my why does MinGW link to these libraries and can I tell it to stop linking to these?

msrd0
  • 7,816
  • 9
  • 47
  • 82
  • It links to msvc runtime. Old post but I think its related: [https://stackoverflow.com/questions/7301995/windows-gnu-compiler-suite-without-external-dependencies](https://stackoverflow.com/questions/7301995/windows-gnu-compiler-suite-without-external-dependencies) – drescherjm Sep 03 '22 at 13:43
  • Also: [https://stackoverflow.com/questions/55728544/how-to-avoid-msvcrt-dll-compiling-with-mingw64](https://stackoverflow.com/questions/55728544/how-to-avoid-msvcrt-dll-compiling-with-mingw64) – drescherjm Sep 03 '22 at 13:46
  • @drescherjm it does link to `msvcrt.dll` as well and I'm fine with anything that's present on Windows 7 and above, but I need to not link those api-ms-win-core-* libraries – msrd0 Sep 03 '22 at 13:53
  • @drescherjm When running [`i686-w64-mingw32-ldd`](https://github.com/xantares/mingw-ldd) those api libraries show up already. I'm fine if those weren't in the binary but loaded by msvcrt at runtime, but this unfortunately does not seem to be the case here. – msrd0 Sep 03 '22 at 13:58
  • I think this explains the dlls you are mentioning better: [https://stackoverflow.com/questions/17023419/windows-7-64-bit-dll-problems](https://stackoverflow.com/questions/17023419/windows-7-64-bit-dll-problems) – drescherjm Sep 03 '22 at 14:07
  • @drescherjm I'm pretty sure I asked a windows user to install microsoft visual c++ redistributable stuff before, but also I'm not using a MSVC toolchain so I wouldn't expect that to necessarily fix it – msrd0 Sep 03 '22 at 14:18
  • You have to install the correct version that matches the mingw – drescherjm Sep 03 '22 at 14:19

0 Answers0