Ask a questionAsk a question
 

QuestionCannot Build Simple C++ Console Project jn VS2010

  • Tuesday, May 19, 2009 7:51 PMpvdg42MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Tried a simple "Hello World" program in VS2010. Source code:

    #include

     

     

    <iostream>

    using

     

     

    namespace std;

    int

     

     

    main()

    {

    cout <<

     

    "Hello world from VS 2010!\n";

     

     

    return 0;

    }

    I created an empty C++ Win32 Console project, then tried to build it with the code above. Works fine in VS2008, but in VS2010, I get:

    Error 1 error LNK2019: unresolved external symbol _wmain referenced in function ___tmainCRTStartup MSVCRTD.lib(wcrtexe.obj) VS2010Crash
    Error 2 error LNK1120: 1 unresolved externals D:\2009_Spring_Students\VS2010Crash\Debug\VS2010Crash.exe VS2010Crash

    ?!? How can simple C++ example programs work in VS2010?