This is just a little ditty I use to keep my Windows dll smaller... I plop this code in somewhere...// This is to prevent the CRT from loading, thus making this a smaller
// and faster dll.
extern BOOL __stdcall _DllMainCRTStartup( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
Sleep(0);
return DllMain( hinstDLL, fdwReason, lpvReserved );
}
I really am not sure why the Sleep(0) is there... I don't remember...
anyway, it knocks my 12k dll down to 6k
If You just use Win32 API and want to drop CRT, check Matt Pietrek's libctiny.lib
QuoteIf You just use Win32 API and want to drop CRT, check Matt Pietrek's libctiny.lib
I am interested... but I link with libctiny and get errors...cannot find libc.lib... I suppose there is complicated stuff involved... I will stay tuned...
Lar.
Test with this prebuild.
You can also use this in one file project:
#pragma nodefaultlib
#pragma comment(lib, "libctiny.lib");
Quote from: TimoVJL on December 09, 2004, 06:20:42 AM
LibCTiny4PC2.ZIP (19.76 kB - downloaded 142 times.)
Timo: Why have you set the -Zl Flag?
Quote/Zl Prevents linker directives from being emitted to the object file.
this way CRT-library is avoided.
Quote from: TimoVJL on October 12, 2014, 03:57:42 PM
Quote/Zl Prevents linker directives from being emitted to the object file.
this way CRT-library is avoided.
Ahhh!
This is a translation error!
In the german IDE -Zl Standardbibliothek in Objektdatei übermitteln
that means the opposite!