CS50 IDE clang:错误:链接器命令失败,退出代码 1
我正在从 CS50 学习 C 编程。我试图建立平价计划。这是我的代码,
# include <cs50.h>
# include <stdio.h>
int main (void)
{
int n=get_int("n: ");
if(n%2==0)
printf("even\n");
else
printf("odd\n");
}
当我尝试编译时出现以下错误,
clang: error: linker command failed with exit code 1
有人能告诉我这里发生了什么吗?
我试图在官方 CS50 IDE 上编译它,但出现了错误。
这是我在 stackoverflow 上的第一个问题,所以如果我做了任何不好的格式或样式,请原谅我。
任何帮助将不胜感激。
I am learning C programming from CS50. I was trying to to build parity program. Here is my code,
# include <cs50.h>
# include <stdio.h>
int main (void)
{
int n=get_int("n: ");
if(n%2==0)
printf("even\n");
else
printf("odd\n");
}
when I try to compile I get the following error,
clang: error: linker command failed with exit code 1
Can anyone tell what's going on here?
I was trying to compile this on official CS50 IDE and I got that error .
This is my first question on stackoverflow, so pardon me if I am doing any bad formatting or styling.
Any help will be highly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己想出来的。有一个与我的 c 源文件同名的文件夹。这就是为什么 clang 感到困惑。
I figured it myself. There was a folder with same name as my c source file. That's why clang got confused.