Author Topic: Weird observation with Visual Studio [Mystery solved]  (Read 7286 times)


  • Member
  • ***
  • Posts: 492
Re: Weird observation with Visual Studio [Mystery solved]
« Reply #15 on: March 18, 2016, 05:53:42 PM »
No just a bare bones c++ application.

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