none
small console program builds with IDE, fails with devenv RRS feed

  • Question

  • I converted a small -- single module project (automatic conversion) from VS 2005 to VS 2012. Its a basic console app.

    The app builds just fine under the IDE. Using devenv, I get the following error:

    LIBCMT.lib(wincrt0.obj) : error LNK2019: unresolved external symbol WinMain referenced in function __tmainCRTStartup

    I have verified he correct subsystem is set (i.e. CONSOLE) -- and like I said, it builds fine from within the GUI. It is just that when using devenv.com the error occurs.

    Any insights on where to look to fix would be appreciated!

    Wim

    Friday, July 20, 2012 8:17 PM

Answers

  • wimcolgate wrote:

    I converted a small -- single module project (automatic conversion)  from VS 2005 to VS 2012. Its a basic console app.

    The app builds just fine under the IDE. Using devenv, I get the  following error:

    LIBCMT.lib(wincrt0.obj) : error LNK2019: unresolved external symbol  WinMain referenced in function __tmainCRTStartup

    I have verified he correct subsystem is set (i.e. CONSOLE)

    Did you check all configurations? Pay attention to Active Configuration  drop-down in the top left corner of the Project Properties dialog.  Perhaps you are building different configurations in the IDE and from  the command line - one correct and one wrong.


    Igor Tandetnik

    • Marked as answer by wimcolgate Friday, July 20, 2012 11:39 PM
    Friday, July 20, 2012 10:14 PM

All replies

  • wimcolgate wrote:

    I converted a small -- single module project (automatic conversion)  from VS 2005 to VS 2012. Its a basic console app.

    The app builds just fine under the IDE. Using devenv, I get the  following error:

    LIBCMT.lib(wincrt0.obj) : error LNK2019: unresolved external symbol  WinMain referenced in function __tmainCRTStartup

    I have verified he correct subsystem is set (i.e. CONSOLE)

    Did you check all configurations? Pay attention to Active Configuration  drop-down in the top left corner of the Project Properties dialog.  Perhaps you are building different configurations in the IDE and from  the command line - one correct and one wrong.


    Igor Tandetnik

    • Marked as answer by wimcolgate Friday, July 20, 2012 11:39 PM
    Friday, July 20, 2012 10:14 PM
  • This is exactly what I found. I came back to answer my own question. All but one of the configurations had the subsystem marked CONSOLE. The other? WINDOWS. Which was the configuration that failed.

    Regards,

    Wim

    Friday, July 20, 2012 11:39 PM