Eclipse CDT-如何在外部控制台(cmd.exe)中运行已编译的.exe [英] Eclipse CDT - how to run compiled .exe in external console (cmd.exe)

查看:260
本文介绍了Eclipse CDT-如何在外部控制台(cmd.exe)中运行已编译的.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以在Eclipse IDE中运行编译的CDT程序,而不是在Eclipse终端中,而是在新的cmd.exe窗口中运行?是某些运行配置还是外部工具配置?
就像在QT中一样,当您运行编译的控制台应用程序时。
我在脑海中搜索了一个简单的问题,但是(对我来说奇怪的是)我没有找到答案。

Is there a way to run compiled CDT program inside Eclipse IDE, but not in Eclipse terminal, but rather in new cmd.exe window? Some Run configuration or External Tools configuration? Just like in QT, when you run compiled console application. I googled this, on my mind, simple question, but (what is strange for me) I didn't find the answer.

推荐答案

在Eclipse CDT论坛中,来自 Klaus先生

From Eclipse CDT forum, from Mr Klaus:

编辑运行配置:

在主页上将C / C ++应用程序设置为:

On the Main page set C/C++ Application to:

${system_path:cmd.exe}

在参数页面上添加(调整路径和程序名称):

On the Arguments page add (adjust path and program name):

/C "start .\Debug\hello.exe"

在通用页面上取消选中分配控制台

On the Common page untick "Allocate console".

在上面的示例中,如果hello.exe结束,则控制台窗口将立即关闭。如果不希望这样,请在参数页面上使用以下版本:

In the example above the console windows will close immediately if hello.exe ends. If you don't want that, use this version on the Arguments page:

/C "start ${system_path:cmd.exe} /K .\Debug\hello.exe"

Btw,您可以使用相同的外部工具配置的概念也是如此!

Btw, you could use the same concept for External Tools configuration also!

这篇关于Eclipse CDT-如何在外部控制台(cmd.exe)中运行已编译的.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆