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:
- Use LoadLibrary("msvcrt.dll") and GetProcAddress() to dynamic load pointer to this functions from standard windows library
- 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