0

When I pass these arguments to the VC++ linker:

link D:\1.obj /OUT:D:\1.exe /SUBSYSTEM:CONSOLE /ENTRY:main

The linker actually treats the string "main" as if it were "_main" (if I were to enter /ENTRY:hello it will treat it as /ENTRY:_hello, etc.).

Why is that? and can I make the linker not add an underscore to the entry point?

1 Answers1

0

This is due to name mangling (more detailed info on VC name mangling here). And I don't think you want to remove it.

nvoigt
  • 75,013
  • 26
  • 93
  • 142