Visual Studio 2013 runs project twice

喜夏-厌秋 提交于 2019-12-17 12:43:08

问题


When I press the "Local Windows Debugger" button when working on any basic C++ project in Visual Studio 2013, the console opens and the program outputs, but when the console closes, another console opens, the UI changes slightly and the program outputs again.

Steps to reproduce:

  1. Create a new C++ project

  2. Inside the "Source Files" directory of the new project, create a file named "main.cpp"

  3. Put a basic hello world program into the file:

    #include &ltiostream&gt

    using namespace std;

    int main() {
        cout &lt&lt "Hello world!";
        cin.get();
    }

  1. Save the code and press the "Local windows debugger" button on the toolbar

  2. A console opens, and waits until you press enter

After the first console closes, a new one opens up, and the UI changes:

Edit: Link to download a zip folder containing the project: Test Project.zip


回答1:


I had avast deepscreen enabled. To disable, goto avast user interface -> Settings -> Antivirus and uncheck the box that says "Enable Deepscreen"




回答2:


On a new version of avast you need to uncheck CyberCapture option. To disable CyberCapture you need to open Avast->Settings->General and uncheck "Enable CyberCapture"




回答3:


I had same problem. Added exception to "c:\source\" where all my visual studio stuff is located.



来源:https://stackoverflow.com/questions/24941918/visual-studio-2013-runs-project-twice

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!