2

I know microsoft recommends against linking to the msvcrt.dll, so please spare me from that warning. They do it all the time in their software (like WinDbg) and they won't introduce breaking changes since all VC6 apps link against msvcrt.dll.

Linking against msvcrt.dll has several benefits. Small executable, easy deployment: msvcrt is there since win98 and I don't have to bundle few MB C runtime with my installer.

Now, is it possible to use gcc to link agains the C library in msvcrt.dll instead of glibc? If yes, how?

Thanks!

George
  • 15,241
  • 22
  • 66
  • 83
  • The inability to link against msvcrt.dll makes me ponder at night, perhaps moving from a MS to a GCC toolset might be worth it. – Chris Becke Aug 22 '09 at 12:41
  • As far as I know it is possible to link to msvcrt.dll with even VisualCpp2008. – George Aug 22 '09 at 12:43
  • 1
    Some useful reading: http://msdn.microsoft.com/en-us/library/ms235460%28VS.80%29.aspx http://kobyk.wordpress.com/2007/07/20/dynamically-linking-with-msvcrtdll-using-visual-c-2005/ http://nn1234.wordpress.com/2008/04/11/vc-90-msvcrtdll-windows-95/ – George Aug 22 '09 at 12:44

1 Answers1

6

AFAIK the MinGW port for gcc does link your program to msvcrt.dll.

Todd Li
  • 3,209
  • 21
  • 19