News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Weird observation with Visual Studio [Mystery solved]

Started by Lonewolff, March 17, 2016, 06:07:31 PM

Previous topic - Next topic

mabdelouahab

Quote from: Lonewolff on March 18, 2016, 07:47:10 AM
No just a bare bones c++ application.

[edit]
After much playing around this morning it is all making sense now.

The entry point isn't actually what we see in our part of the source code (in this case '_main'). The entry point is '_mainCRTStartup' which is hidden away in the lib files.

It appears that _mainCRTStartup is doing all of the initialisation of the console etc.

So, even though I asked VS to compile a program that returns zero to the operating system, it is adding in all sorts of other crap assuming that I want this to all happen in a console window (which in this case is all additional unwanted stuff).

Mystery solved  8)

If your problem is The entry point then you can be specify by /ENTRY:main ,or by Setting Visual C++ Project Properties., In this case, the linker does not include anything and the size of the program becomes 1kb
The way you put the problem tired Mr.Jochen