Visual Studio 2012. "unable to start program" *.exe "cannot find the file specified"

Visual Studio 2012. "unable to start program" *.exe "cannot find the file specified"

本文关键字:cannot exe find the file specified program 2012 Studio unable to      更新时间:2023-10-16

是的,我知道这是一个常见的问题。没有其他问题/答案集满足我在这里的需求。本季度以 c++ 为例。一直很好。尝试执行最后一项作业,我收到上述错误,即使在一个新项目中也是如此:

#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
    cout << "hello world" << endl;
}

作为实验,我尝试粘贴以前作业中更复杂的代码。这将运行。只是粘贴 - 而不是运行上一个作业。

我选择了其中最简单的一个,并将其剥离为:

主.cpp:


#include <iostream>
using namespace std;
int main()
{
   double hours, rate;
   cout << "Hello World";
   cin >> hours;
   cout << "Hello World";
   cin >> rate;
   system("pause");
   return 0; 
}

这样可以编译并运行良好。但是,如果我删除cin行中的任何一行,则会出现标题中指出的错误。

我只是大吃一惊,因为粘贴在代码中可以编译和运行,但即使是新项目中的"Hello World"也不会。

我上面的例子提供了任何线索吗?

如果您以管理员身份运行它,它会发生吗?您是从Visual Studio运行它还是单击了可执行文件?

如果您有防病毒软件,它也可能导致错误。