简体   繁体   English

C ++错误:“无法启动程序'filepath.exe',系统找不到指定的文件

[英]C++ error: "Unable to start program 'filepath.exe' The system cannot find the file specified

Using Visual Studios 2017 (Updated last week). 使用Visual Studios 2017(上周更新)。 Get the error "Unable to start program "filepath.exe" the system cannot find the file specified. 收到错误“无法启动程序“ filepath.exe”,系统找不到指定的文件。

Below is the "Hello World" function I'm running, but the issue isn't with the code, it's somewhere in my setup. 以下是我正在运行的“ Hello World”功能,但问题与代码无关,它在我的设置中。 I had Visual Studios working 6 months ago to start learning C++, but now that I've come back and updated VS, it isn't working anymore. 我六个月前曾让Visual Studios开始学习C ++,但是现在我回来并更新了VS,它不再起作用了。

The code compiles okay (or so it says), but then throws the error above when I attempt to use the local windows debugger to run the code. 该代码可以编译(或可以这样说),但是当我尝试使用本地Windows调试器运行代码时,则抛出上述错误。 When I searched for the "filepath.exe" file, but it isn't in the specified folder, nor can I find a .exe file of any kind anywhere within the project working directory. 当我搜索“ filepath.exe”文件时,该文件不在指定的文件夹中,也无法在项目工作目录中的任何位置找到任何类型的.exe文件。 There are a lot of questions on stackoverflow that go over this issue, but none of them solved my problem. 关于stackoverflow的问题很多,但都没有解决我的问题。

I checked all the properties (Solution explorer >> Project Name >> Properties) and here is my current setup: 我检查了所有属性(解决方案资源管理器>>项目名称>>属性),这是我当前的设置:

General: 一般:

Output Directory: $(SolutionDir)$(Configuration)\\ Intermediate Directory: $(Configuration)\\ Target Name: $(ProjectName) Target Extension: .exe 输出目录:$(SolutionDir)$(Configuration)\\中间目录:$(Configuration)\\目标名称:$(ProjectName)目标扩展名:.exe

Debugging: 调试:

Command: $(TargetPath) Working Directory: $(ProjectDir) Attach: "No" Debugger Type: "Auto" 命令:$(TargetPath)工作目录:$(ProjectDir)附加:“ No”调试器类型:“ Auto”

Linker: 连结器:

Output File:$(OutDir)$(TargetName)$(TargetExt) Show Progress: Not Set 输出文件:$(OutDir)$(TargetName)$(TargetExt)显示进度:未设置

I'm using a single .cpp file in a "blank" type C++ Project. 我在“空白”类型的C ++项目中使用单个.cpp文件。

#include<iostream>
using namespace std;
int main() {
    cout << "Hello StackOverFlow";
    return 0;
}

Any help on how to go about troubleshooting this would be helpful. 有关如何进行故障排除的任何帮助都将有所帮助。 New to compiled languages. 编译语言的新手。

Just saw the problem in your code which is actually giving you an error . 刚在代码中看到问题, 实际上在给您一个错误 Your code is as follows: 您的代码如下:

    #include<iostream>
    using namespace std;
    int main() {
        cout << "Hello StackOverFlow";
        return 0;
    }

If you notice closely, you have not left a space in between #include<iostream> which is giving you a run time error and states that the specified file cannot be found. 如果您密切注意,则 #include<iostream> 之间没有留下空格,这将给您带来运行时错误并指出找不到指定的文件。 If you left space as in: 如果您按照以下方式留出空间:

     #include <iostream>
     using namespace std;
     int main() {
         cout << "Hello StackOverFlow";
         return 0;
     }

It will not give you an error. 它不会给你一个错误。 I hope this helps you overcome the issue. 希望这可以帮助您解决问题。 Glad to help you Phillips! 很高兴为您提供帮助! :) :)

It happened with me too sometimes when I was new to the language. 当我刚接触该语言时,有时也会发生在我身上。 It usually occurs when you accidentally delete the file. 通常在意外删除文件时发生。 So you can solve this issue by creating a new C++ empty project, enter a new item: the source-code file and then copy this code in the new file. 因此,您可以通过创建一个新的C ++空项目,输入一个新项目(源代码文件)并将此代码复制到新文件中来解决此问题。 It should work equally well and good. 它应该同时工作良好。 I hope my answer helped you overcome the issue! 希望我的回答能帮助您解决问题! :) :)

暂无
暂无

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

相关问题 错误:无法启动程序“*.exe”系统找不到指定的文件 - Error: unable to start program "*.exe" the system cannot find the file specified 无法启动程序:系统找不到指定的文件。 (C ++ BTW) - Unable to Start Program: The system cannot find the file specified. (C++ BTW) 无法启动“program.exe” 系统找不到vs2008指定的文件 - unable to start "program.exe" the system cannot find the file specified vs2008 Visual Studio:无法启动程序,系统找不到指定的文件 Visual Studio 错误? - Visual Studio: Unable to start program, the system cannot find the file specified visual studio error? “运行C ++程序时,系统无法找到指定的文件” - “The system cannot find the file specified” when running C++ program Visual Studio2012。“无法启动程序” * .exe“找不到指定的文件” - Visual Studio 2012. “unable to start program” *.exe “cannot find the 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 无法启动程序VS2015 | 访问被拒绝| 系统找不到指定的文件 - Unable to start program VS2015 | Access denied | system cannot find the file specified “+1 超载 --- Function 未找到“...”的定义”以及“无法启动程序。系统找不到指定的文件” - "+1 Overload --- Function definition for '...' not found" Along With "Unable to start program. The system cannot find the file specified" 视觉工作室。 无法启动程序 &#39;&#39; 系统找不到指定的文件 - Visual Studio. Unable to start program '' The system cannot find the file specified
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM