Eclipse CDT不会运行编译的exe文件 [英] Eclipse CDT won't run compiled exe files
问题描述
所以我决定安装Eclipse CDT作为我选择的IDE。但是,似乎一旦我开始运行需要输入的C程序,Eclipse决定在控制台窗口中停止运行文件。我尝试在任务管理器中关闭程序的所有实例,我在计算机上找到的exe文件工作正常。我试图构建文件,然后运行,但Eclipse表示我已经没有任何建立。任何想法?
So I decided to install the Eclipse CDT as my chosen IDE. However, it seems like once I began to start running a C program that required input, Eclipse decides to stop running the files in the console window. I tried closing all the instances of the program in Task Manager, and the exe file I found on my computer works well. I tried to build the file, then run but Eclipse said that I had "nothing to build". Any ideas?
代码:
#include <stdio.h>
int main(void) {
int length, width, height, volume, weight;
printf("Enter the length of box: ");
scanf("%d", &length);
printf("Enter the height of box: ");
scanf("%d", &height);
printf("Enter the width of box: ");
scanf("%d", &width);
volume = length * width * height;
weight = ((volume/166.0) + 0.5);
printf("Volume(cubic inches) %d\n", volume);
printf("Dimensional weight(pounds): %d\n", weight);
return 0;
}
推荐答案
工作:
Goto Run - 运行配置 - C / C ++ - 您的Exe
Goto Run - Run Configuration - C / C++ - Your Exe
点击参数
在工作区中,取消选中使用默认值
In the workspace section uncheck "use default"
然后选择exe所在的目录,例如调试
Then select the directory where the exe resides e.g. debug
这篇关于Eclipse CDT不会运行编译的exe文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!