eclipse 它不会编译并给出“无法启动选择并且最近没有启动”错误。

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25936902/
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-09-19 21:59:58  来源:igfitidea点击:

It will not compile and gives the "Selection cannot be launched and there are no recent launches” error.

c++eclipse

提问by Seba

errorI tried to build and run "Hello world" with Eclipse and it wont run. I don't use Android or anything else just plain C++.

错误我尝试使用 Eclipse 构建和运行“Hello world”,但它无法运行。我不使用 Android 或其他任何东西,只是简单的 C++。

http://i57.tinypic.com/x51h5h.png

http://i57.tinypic.com/x51h5h.png

回答by Algorithmic

So I've had this issue a bunch of times before. This is what worked for me:

所以我之前遇到过很多次这个问题。这对我有用:

Go to the Projects tab at the top, then Properties>C/C++ Build>Settings, click on Binary parsers tab and select "PE Windows Parser" and then click on Error Parsers tab and select "Microsoft Visual C error parser"

转到顶部的 Projects 选项卡,然后 Properties>C/C++ Build>Settings,单击 Binary parser 选项卡并选择“PE Windows Parser”,然后单击 Error Parsers 选项卡并选择“Microsoft Visual C error parser”

All that for good measure. Now, click apply and then right click on your project and "Build". Then click on the play button on top which would run your application and it should run.

所有这一切都是为了很好的衡量。现在,单击应用,然后右键单击您的项目和“构建”。然后单击顶部的播放按钮,它将运行您的应用程序,它应该会运行。

1 more thing: When you add your test.cpp file: Right click on the project folder, New>Source File and then add test.cpp in the Source file edit box. That should do it!

另一件事:添加 test.cpp 文件时:右键单击项目文件夹,新建>源文件,然后在源文件编辑框中添加 test.cpp。应该这样做!

回答by utkarshp64

To fix this error, follow these steps:

要修复此错误,请按照下列步骤操作:

  1. Go to Window -> Preferences -> Run/Debug -> Launching
  2. In Launching -> Launch Operationselect "Launch the associated project". For help, keep the options as the image below:
  1. Window -> Preferences -> Run/Debug -> Launching
  2. Launching -> Launch Operation选择“启动相关项目”。如需帮助,请保留下图所示的选项:

enter image description here

在此处输入图片说明

  1. Select "Run as Local C/C++ application"
  1. 选择“作为本地 C/C++ 应用程序运行”