简体   繁体   English

Visual Studio2012。“无法启动程序” * .exe“找不到指定的文件”

[英]Visual Studio 2012. “unable to start program” *.exe “cannot find the file specified”

Yes, I know this is a common question. 是的,我知道这是一个常见问题。 No other question/answer sets meet my needs here. 这里没有其他问题/答案集可以满足我的需求。 Taking c++ this quarter. 本季度学习C ++。 Been going along just fine. 一直很好。 Trying to do last assignment, and I'm getting the above error, even on a fresh project with: 尝试做最后一次分配,即使在一个新项目中,我也遇到上述错误:

#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{
    cout << "hello world" << endl;
}

As an experiment, I tried pasting in much more elaborate code from previous assignments. 作为一个实验,我尝试粘贴以前任务中更复杂的代码。 This runs. 运行。 Just pasting in -- not running the previous assignment. 只是粘贴-不运行上一个作业。

I took the simplest of them, and stripped it down to this: 我选择了其中最简单的一个,并将其简化为:

Main.cpp: Main.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; 
}

This compiles and runs fine. 这样可以编译并正常运行。 However, if I remove either of the cin lines I get the error stated in the title. 但是,如果我删除任何一条cin行,都会出现标题中指出的错误。

I'm just flabbergasted because pasted in code compiles and runs, but even "Hello World" in a fresh project won't. 我很吃惊,因为粘贴在代码中可以编译和运行,但是即使在新项目中也无法实现“ Hello World”。

Does my above example provide any clues? 我上面的示例是否提供任何线索?

Does it happen if you run it as administrator? 如果以管理员身份运行它会发生吗? Were you running it from Visual Studio or did you clicked the executable? 您是从Visual Studio运行它还是单击可执行文件?

If you have an anti virus, it may be causing the error as well. 如果您有防病毒软件,它也可能导致错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio:无法启动程序,系统找不到指定的文件 Visual Studio 错误? - Visual Studio: Unable to start program, the system cannot find the file specified visual studio error? 错误:无法启动程序“*.exe”系统找不到指定的文件 - Error: unable to start program "*.exe" the system cannot find the file specified 视觉工作室。 无法启动程序 &#39;&#39; 系统找不到指定的文件 - Visual Studio. Unable to start program '' The system cannot find the file specified C ++错误:“无法启动程序&#39;filepath.exe&#39;,系统找不到指定的文件 - C++ error: "Unable to start program 'filepath.exe' The system cannot find the file specified 无法启动“program.exe” 系统找不到vs2008指定的文件 - unable to start "program.exe" the system cannot find the file specified vs2008 Visual Studio 调试器错误:无法启动程序 找不到指定文件 - Visual Studio debugger error: Unable to start program Specified file cannot be found Microsoft Visual Studio:找不到指定的文件 - Microsoft visual studio: Cannot find file specified 无法启动程序“MYPATH.exe”。 该系统找不到指定的文件。 当我尝试运行一个新的“hello world”控制台应用程序时 - Unable to start program 'MYPATH.exe'. The system cannot find the file specified. When i try to run a new 'hello world' console application 无法启动程序:系统找不到指定的文件。 (C ++ BTW) - Unable to Start Program: The system cannot find the file specified. (C++ BTW) “+1 超载 --- Function 未找到“...”的定义”以及“无法启动程序。系统找不到指定的文件” - "+1 Overload --- Function definition for '...' not found" Along With "Unable to start program. The system cannot find the file specified"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM