gcc 重新编译“make”结果没有变化
我正在使用 cs50 设备。
我尝试编写一个新文件 test.c ,发现只要我包含 int i 行,它就不会生成新文件 test,如果我删除该行并再次 make,它可以生成测试文件。然后我对测试文件进行了更改,它仍然输出原始文件结果,没有反映新的更改。
#include
#include
int
main (void)
{
printf("Number: \n");
int i = GetInt();
}
它之前运行正常...有人可以帮忙吗?
i'm using cs50 appliance.
i've tried to write a new file test.c , found as long as i include int i line, it doesn't generate a new file test, if i remove that line and make again, it can generate test file. then i made changes on the test file, it still output the original file result, no reflect the new changes.
#include <stdio.h>
#include <cs50.h>
int
main (void)
{
printf("Number: \n");
int i = GetInt();
}
it was running properly before though... anyone can help please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然,您的
make
默认规则在test.c
上运行编译器。编译器注意到您正在为变量 i 赋值,但您从未以任何方式使用该值;它通常会将此报告为警告。
显然,您的编译器或
make
的配置方式使得此警告成为make
的致命错误。补救措施是使用变量。看起来您似乎需要拿起一本有关 C 编程语言的书,或者学习一门课程(如果您还没有这样做的话)。
Apparently your default rules for
make
run the compiler ontest.c
.The compiler notices that you are assigning a value to variable
i
, but you never use that value in any way; it would normally report this as a warning.Apparently either your compiler or
make
are configured in such a way that this warning becomes a fatal error tomake
.The remedy is to use the variable. It looks as though you need to pick up a book on the C programming language, or follow a course, if that's not what you're doing already.