Hello,

I compiled and linked very simple memcmp() example with mingw-w64
runtime and with latest ms runtime (both 32-bit). Tested example is:

  __declspec(dllimport) int memcmp(const void *a, const void *b, unsigned s);
  int main(int argc, char *argv[]) { return memcmp(argv[0], "abc", 3); }

ms tools created executable which imports memcmp symbol from
VCRUNTIME140.dll library. But mingw-w64 imports memcmp symbol from
api-ms-win-crt-private-l1-1-0.dll library.

I looked at VCRUNTIME140.dll and api-ms-win-crt-private-l1-1-0.dll and
seems that both libraries provide similar set of symbols.

It is correct that mingw-w54 links with api-ms-win-crt-private-l1-1-0.dll?
Should not it do same thing as ms vc, so link with VCRUNTIME140.dll?
Meaning that api-ms-win-crt-private-l1-1-0.def would be replaced by
vcruntime140.def when creating libucrt.a archive?

Microsoft describes its import (and runtime) libraries in this article:
https://learn.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-170

So seems that their ucrt.lib import library contains import symbols for
all those api-ms-*.dll (except api-ms-win-crt-private-l1-1-0.dll), then
vcruntime.lib contains import symbols for VCRUNTIME140.dll (where are
memset, memcpy, ...) and then static library msvcrt.lib which contains
startup code.

If I compare it with mingw-w64, then MS msvcrt.lib is like mingw-w64's
libmingw32.a (where is startup code) and MS ucrt.lib + vcruntime.lib is
like mingw-w64's libucrt.a (where are import symbols for CRT).


Note that there is also vcruntime140_app.dll. Where is this used?

Pali


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to