Discussion:
msvcrt.dll
(too old to reply)
Paul Edwards
2019-05-27 15:56:49 UTC
Permalink
I would like to make my own C runtime
library (PDPCLIB) produce a mini version
of msvcrt.dll.

Someone actually previously submitted a
code change so that PDPCLIB could be a
DLL, although I've never used that before.
They added a #define for __declspec(dllexport)
and put that against all exported function
names.

That is fine for functions like printf,
but he also added functions like
__get_main_fp which you can see being
called here:

https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpclib/w32start.c

and being defined around here:

https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpclib/start.c#l63

This prevents my executables from using
the standard msvcrt.dll, as I get a not
found error on these extra function names.

Any suggestions on how to convert PDPCLIB
to be more in tune with Microsoft?

Thanks. Paul.
Kaz Kylheku
2019-05-27 19:16:13 UTC
Permalink
Post by Paul Edwards
This prevents my executables from using
the standard msvcrt.dll, as I get a not
found error on these extra function names.
msvcrt.dll is an internal Windows library that applications are not
supposed to be using anyway. It isn't documented anywhere.

A good backgrounder on this issue is this article:

"Windows is not a Microsoft Visual C/C++ Run-Time delivery channel"

https://devblogs.microsoft.com/oldnewthing/?p=1273
Rick V
2019-07-18 05:28:50 UTC
Permalink
Post by Kaz Kylheku
Post by Paul Edwards
This prevents my executables from using
the standard msvcrt.dll, as I get a not
found error on these extra function names.
msvcrt.dll is an internal Windows library that applications are not
supposed to be using anyway. It isn't documented anywhere.
"Windows is not a Microsoft Visual C/C++ Run-Time delivery channel"
https://devblogs.microsoft.com/oldnewthing/?p=1273
(Thunderbird places the reply button _before_ the news reply/followup
button. Ew.)

The lone exception to this would be mingw-w64, but its source code dates
back to the mid-90s with the original mingw32 project, so it gets a pass
(sort of). In spite of this, it has a special -mcrtdll=-l[something]
switch to pick a newer version of Microsoft libc or the new Universal
CRT (for which import libraries now exist in its fork of the ReactOS
Windows SDK)

Hope this helps
R

Loading...