entry.md

October 10, 2024 ยท View on GitHub

Asmc Linker Reference

/ENTRY

/ENTRY:function

The /ENTRY option specifies an entry point function as the starting address for an .exe file or DLL.

By default, the starting address is a function name from the C run-time library. The linker selects it according to the attributes of the program, as shown in the following table.

Function nameDefault for
mainCRTStartup (or wmainCRTStartup)An application that uses /SUBSYSTEM:CONSOLE; calls main (or wmain)
WinMainCRTStartup (or wWinMainCRTStartup)An application that uses /SUBSYSTEM:WINDOWS; calls WinMain (or wWinMain), which must be defined to use WINAPI-call
_DllMainCRTStartupA DLL; calls DllMain if it exists, which must be defined to use WINAPI-call

If the /DLL or /SUBSYSTEM option is not specified, the linker selects a subsystem and entry point depending on whether main or WinMain is defined.

The functions main, WinMain, and DllMain are the three forms of the user-defined entry point.

See Also

Asmc Linker Reference