gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 05:46:05 24 4
gpt4 key购买 nike

所以我决定安装 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;
}

最佳答案

我刚试过这个,它奏效了:

转到运行 - 运行配置 - C/C++ - 你的 Exe

单击“参数”选项卡

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

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

enter image description here

关于c - Eclipse CDT 不会运行已编译的 exe 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10670950/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com