-1

The default file when I select console application is

#include "stdafx.h"
int main()
{
  return 0;
}

When I click "local windows debugger", the program freezes and nothing happens. Is it possible my debug compiler is not linked to the correct executables?

linuxfreebird
  • 799
  • 2
  • 8
  • 16
  • Do you use Avast antivirus? If so, try disabling it and then test your program. There have been several similar questions on SO recently and Avast was the problem. – Blastfurnace Nov 21 '15 at 23:19
  • @Blastfurnace How do I disable Avast? – linuxfreebird Nov 21 '15 at 23:21
  • I don't use Avast so I can't answer that. There should also be a way to add an exclusion for your project folder somewhere in the Avast settings. That would be preferable to completely disabling your antivirus. – Blastfurnace Nov 21 '15 at 23:23
  • @Blastfurnace I discovered that Avast was the problem. Simply disabling Avast fixed it for me. – linuxfreebird Nov 22 '15 at 13:00

1 Answers1

1

The way it's currently written this will result in a syntax error compilation fault because you forgot a ; after return 0. It's most likely just instantly closing the program though, try to run this code and check if it prints out :

Hello, World!

#include "stdafx.h"

#include <iostream>
int main()
{
  std::cout << "Hello, World!" << std::endl;
  std::cin.get();
  return 0;
}

If this still "freezes" your debugger then I suggest reinstalling your Visual Studio.

Hatted Rooster
  • 35,759
  • 6
  • 62
  • 122