Visual Studio 2015 failing to compile program


  • I am a beginner into the world of C++ and programming in general. I downloaded a tutorial a couple of days ago, and the instructor in it compiled a program which I can't seem to compile. I've followed the exact same steps as he does but in the end I'm left with the same error. I'm pretty sure the error is not from my code, and it is from some unchecked function in visual studio. This is my error: "C:\Users\tripl\Desktop\Rock...paper...carbon\Work\VisualStudio\C++\Section_02\Debug\BullCowGame.exe" is not recognized as an internal or external command, operable program or batch file.

    This is my code:
         int Main()
                return 0;

     Now I fiddled around a bit and what I could deduce was that this error only happens when I start an empty project from the selection menu itself. If I don't start with an empty project I have the '#include' namespaces and so on and I don't encounter this problem. If I press f7 it says the build is successful. I understand what the error is (somehow the .exe is not being created) but I don't understand why it happens only when I compile it from an empty project. I've checked various responses from this forums (most of them I couldn't understand) but there were a few who pointed that it may be a problem with the path. But it isn't.
    Tuesday, April 11, 2017 2:54 PM

All replies

  • It is main(), not Main()

    See MSDN tutorials , like :

    Chapter 1: Programming With Visual C++ 2010

    Tuesday, April 11, 2017 3:16 PM
  • Hi,

    Is there any update about your issue?

    If you think Castorix31's reply is helpful, please mark the reply as an answer. If you still have the issue, please feel free to let me know.

    Best regards,


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Wednesday, April 19, 2017 1:48 AM