Are you calling this function directly?  Where did you get the header
for this (it appears to be in "setlocal.h", which doesn't come with
the mingw win32-api at all)?

Can you just use GetConsoleCP()
- I'm not familiar with ___lc_codepage_func, but it sounds like the
same thing

Well, I solved that problem. In my haste and frustration, I neglected to realize that I was using an unofficial build of MinGW, namely the Equation.com build. I had used this binary distribution to gain access to a feature I wanted to test in 4.6, of which there was no official build at the time. I guess they are doing something in their particular configuration, since when I tried a different distribution, the executable can be created on XP and run on Windows 2000, no problem.

It was just a simple "Hello World" like program, not doing anything fancy, so no, I was not calling the function directly, though it seems the unofficial distribution I was using, was.

Anything involving Visual Studio or the WDK is out of scope for this
list - there quite a few places online where you can instructions for
getting Visual Studio to link to msvcrt.dll using the WDK if that is
what you want to do (I don't know if it is possible to link statically
in in this case).

Well, all I really wanted to know was if there was an option in MinGW that corresponded to the /MT option in Visual Studio. That is, when a program is built with that option, the executable does not depend on msvcrt.dll, rather the C runtime library is statically linked, whereas using the /MD option does make the executable depend on msvcrt.dll.

I was just wondering if there might be some way of flagging MinGW that I want to build an executable that does not depend on msvcrt.dll, but rather statically links the .lib (I think libcmt.lib is what Visual Studio uses). I still wanted to build the executable with MinGW, my mention of Visual Studio was merely for comparison's sake. I was hoping for something like:


I guess my question could be simplified to:

Does MinGW always produce executables that depend on msvcrt.dll?

Thank you very much for your time.
John N.