我完全是计算机科学的新手,我目前正在首先在 VS 代码上使用 C 程序学习 CS50。另外,我正在使用 Mac M1 来运行代码。
这是我的代码:
#include <stdio.h>
int main(void)
{
printf ("helloworld\n");
}
我多次运行代码“helloworld”,但系统总是说:
cc hello1.c -o hello1
Undefined symbols for architecture arm64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我在许多平台上找到了一些方法并尝试了它们包括:
设置自制软件
点击设置中的“在终端中运行”和“运行前保存文件”
但是,所有这些都不适用于我的情况,我现在很沮丧。非常感谢大家的支持和帮助解决这个问题。非常感谢!