1

I want to reduce size of my win32 applications programmed in MS Visual Studio C++ and I also want to have guaranteed compatibility on all Windows version (XP and upper without Visual C++ Redistributable Package). I used /MT and /NODEFAULTLIB parameter to reduce file size and get rid of C Run-Time library. But I lost access to functions like malloc, free, strcat, strstr, etc... What is the best approach to bypass this problem?

I'm thinking about this alternatives:

  1. Use LoadLibrary("msvcrt.dll") and GetProcAddress() to dynamic load pointer to this functions from standard windows library
  2. Program this function by myself for example replace malloc with VirtualAlloc(), free with VirtualFree() etc..

Or is it some other solution for my problem? Thank you

4

1 回答 1

1

I'll probably never understand why people want to do that (PCs are not exactly embedded platforms with all their size issues), but there's basically three options:

于 2012-08-18T19:39:56.013 回答