关于/ENTRY (Entry-Point Symbol)

  • 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.
  • 关于VS2005:LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
    • 建一CUI程序
    • Use Unicode Character Set
    • Entry Point :wmain
    • Rebuild则出现上述错误,奇怪的是错误提示_main没有定义,而不是_wmain??
    • 估计原因:默认情况下,linker通过Character set和SubSystem选择entry point function(见上表),再链接我们定义的入口函数(_main(_wmain)或WinMain(wWinMain))。现改变了Entry Point,则linker默认链接_main函数,无法找到,故错误提示。
    • 若重新定义一main函数或修改Character set为Use Multi-Byte Character Set,则会链接成功。
posted @ 2011-08-09 09:59  iThinking  阅读(566)  评论(0编辑  收藏  举报