Eclipse CDT不会运行已编译的exe文件

时间:2012-05-20 05:14:12

标签: c eclipse

所以我决定安装Eclipse CDT作为我选择的IDE。但是,似乎一旦我开始运行需要输入的C程序,Eclipse决定停止在控制台窗口中运行文件。我尝试在任务管理器中关闭程序的所有实例,我在计算机上找到的exe文件运行良好。我尝试构建该文件,然后运行,但Eclipse说我没有“无需构建”。有什么想法吗?

代码:

#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;
}

1 个答案:

答案 0 :(得分:3)

我刚尝试了这个并且有效:

转到运行 - 运行配置 - C / C ++ - 您的执行

单击“参数”选项卡

在工作区部分取消选中“使用默认值”

然后选择exe所在的目录,例如调试

enter image description here

相关问题