C++ 启动配置中指定的程序文件不存在

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13690644/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 17:38:34  来源:igfitidea点击:

The program file specified in the launch configuration does not exist

c++ceclipse

提问by user1873644

I am facing some problems regarding eclipse for c/c++. I am trying to create a new project, I provide the code, and after running the code I get this error:

我正面临一些关于 c/c++ eclipse 的问题。我正在尝试创建一个新项目,我提供了代码,在运行代码后出现此错误:

The program file specified in the launch configuration does not exist
C:\Users\elisabeth\workspace\mm\Debug\mm.exe not found

Please notice that I am working with spice toolkit; I set the path for the "include" files and the libraries, but still I can not have a result.

请注意,我正在使用 spice 工具包;我设置了“包含”文件和库的路径,但仍然没有结果。

What causes this error and how can I resolve it?

导致此错误的原因是什么,我该如何解决?

回答by Nenad Bulatovic

  1. Right click on your project --> Properties
  2. Run/Debug settings
  3. Delete whatever is set as "launch configuration for '........'
  4. Project --> Clean
  5. Project --> Build Project
  1. 右键单击您的项目--> 属性
  2. 运行/调试设置
  3. 删除任何设置为“'......'的启动配置”
  4. 项目 --> 清洁
  5. 项目 --> 构建项目

回答by incrediblehulk

You can create a run configuration. Go to Run > Run Configurations. Click Newbutton, fill C/C++ Applicationfield, i.e., insert path to your executable. The new configuration will appear in the list which appears when you click to the arrow next to run button.

您可以创建运行配置。去Run > Run Configurations。单击New按钮,填充C/C++ Application字段,即插入可执行文件的路径。新配置将出现在您单击运行按钮旁边的箭头时出现的列表中。

Of course this assumes your can build without problems, otherwise you won't see an executable to point to.

当然,这假设您可以毫无问题地构建,否则您将看不到指向的可执行文件。

回答by Tahseen

You can clean the project, build it again and run it as a local C/C++ application. Simplified steps as follows,

您可以清理项目,重新构建它并将其作为本地 C/C++ 应用程序运行。简化步骤如下,

  1. Right click on the project
  2. Clean Project
  3. Again Right click on the project
  4. Build Project
  5. Again Right click on the project
  6. Run As ->
  7. Local C/C++ Application
  1. 右键单击项目
  2. 清洁工程
  3. 再次右键单击项目
  4. 构建项目
  5. 再次右键单击项目
  6. 运行方式 ->
  7. 本地 C/C++ 应用程序

回答by sdevikar

As the error reads:

正如错误所写:

C:\Users\elisabeth\workspace\mm\Debug\mm.exe not found
  1. First of all you need to check whether there is an executable "mm.exe" in your Debug folder. (Of course, it is not there and that is why the error)

  2. Go to Project > Clean and you should see some files being deleted from your Debug folder

  3. Go to Project > Build Project and you should see some new files being generated e.g. mm.d, mm.o, mm. This "mm" is probably the executable you're looking for

  4. Now that you know what your executable is, you should tell eclipse what file to execute instead of mm.exe. Go to Project properties and in run debug settings create a new configuration (or edit an existing configuration, if there is one already). In this configuration, in main tab, in C/C++ Application specify a full path to "mm". Which, in your case is - "C:\Users\elisabeth\workspace\mm\Debug\mm"A better way to do this in eclipse is:

    ${project_loc}/"your folder"/"your executable file"

  1. 首先,您需要检查 Debug 文件夹中是否有可执行文件“mm.exe”。(当然,它不存在,这就是错误的原因)

  2. 转到 Project > Clean,您应该会看到一些文件正在从 Debug 文件夹中删除

  3. 转到 Project > Build Project,您应该会看到正在生成一些新文件,例如 mm.d、mm.o、mm。这个“mm”可能是你正在寻找的可执行文件

  4. 现在您知道您的可执行文件是什么,您应该告诉 eclipse 执行哪个文件而不是 mm.exe。转到项目属性并在运行调试设置中创建一个新配置(或编辑现有配置,如果已有配置)。在此配置中,在主选项卡中,在 C/C++ 应用程序中指定到“mm”的完整路径。其中,在您的情况下是 -"C:\Users\elisabeth\workspace\mm\Debug\mm"在 Eclipse 中执行此操作的更好方法是:

    ${project_loc}/“您的文件夹”/“您的可执行文件”

e.g.${project_loc}/Debug/mm

例如${project_loc}/Debug/mm

回答by Vlad

Avoid troubles with configuration by going into Project properties > C/C++ build > Refresh Policyand specify your project folder. The configuration option "Search project" will show a correct folder then and you will see whatever you build there - Debug, Release or both. You don't want to specify the folder using Browse option every time you import project or switch configurations.

通过进入项目属性> C/C++ 构建>刷新策略并指定您的项目文件夹,避免配置问题。配置选项“搜索项目”将显示一个正确的文件夹,然后您将看到您在那里构建的任何内容 - 调试、发布或两者兼而有之。您不想在每次导入项目或切换配置时使用浏览选项指定文件夹。

回答by Samer

what worked for me is file->refresh

对我有用的是 file->refresh

then do the Debug configuration again by choosing the right c/c++ binary again.

然后通过再次选择正确的 c/c++ 二进制文件再次进行调试配置。

回答by James Raynard

As this is the first SO discussion that appears for this topic on Google and none of the answers solved the problem my students were having, I would like to mention the solution we eventually found from this answer:

由于这是在 Google 上针对此主题出现的第一个 SO 讨论,并且没有一个答案解决了我的学生遇到的问题,因此我想提一下我们最终从这个答案中找到的解决方案:

  1. Open project properties (Right click on your project, choose Properties on the menu)
  2. C/C++ Build -> Settings
  3. Click on Binary Parsers tab and check PE Windows Parser
  4. Keep clicking Move Up until it is at the top
  1. 打开项目属性(右键单击您的项目,在菜单上选择属性)
  2. C/C++ 构建 -> 设置
  3. 单击 Binary Parsers 选项卡并检查 PE Windows Parser
  4. 继续点击 Move Up 直到它位于顶部

This had been set to Elf, even though we were using a freshly downloaded Windows version of Eclipse.

这已设置为 Elf,即使我们使用的是新下载的 Windows 版本的 Eclipse。

回答by Timucin

sometime missed closing curly brace can be part of a problem. Make sure prototype your function at the beginning of the file. Then right click your project in the left side bar. click clean project. then click build project and finally run project

有时错过关闭大括号可能是问题的一部分。确保在文件的开头对您的函数进行原型设计。然后在左侧栏中右键单击您的项目。单击清理项目。然后单击构建项目,最后运行项目