This is part of a series of at least two closely related, but distinct questions. I hope I'm doing the right thing by asking them separately.
I'm trying to get my Visual C++ 2008 app to work without the C Runtime Library. It's a Win32 GUI app without MFC or other fancy stuff, just plain Windows API.
So I set Project Properties -> Configuration -> C/C++ -> Advanced -> Omit Default Library Names to Yes (compiler flag /Zl
) and rebuilt.
Then the linker complains about an unresolved external _WinMainCRTStartup
. Fair enough, I can tell the linker to use a different entry point, say MyStartup
. From what I gather around the web, _WinMainCRTStartup
does some initialization stuff, and I probably want MyStartup
to do a subset of that.
So my question is: What functions does _WinMainCRTStartup
perform, and which of these can I omit if I don't use the CRT?
If you are knowledgeable about this stuff, please have a look at my other question too. Thanks!
Aside: Why do I want to do this in the first place?
The CRT's entry point does the following (this list is not complete):
The CRT source code is available with Visual Studio and you can step through the CRT's entry point in a debugger and find out exactly what it is doing.