Clang 如何/有可能建立C";“你好,世界”;程序完全静态(OSX,叮当声)?

Clang 如何/有可能建立C";“你好,世界”;程序完全静态(OSX,叮当声)?,clang,static-linking,Clang,Static Linking,是否有可能编译C“Hello world”程序,使最终的可执行文件完全静态 #include <stdio.h> int main() { printf("hello world!\n"); return 0; } 但它给出了: ld: library not found for -lcrt0.o clang: error: linker command failed with exit code 1 (use -v to see invocation) 我已

是否有可能编译C“Hello world”程序,使最终的可执行文件完全静态

#include <stdio.h>

int main() {
    printf("hello world!\n");

    return 0;
}
但它给出了:

ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我已经看过了,但是我想得到关于这个话题的更多信息


另外,我问这个问题是为了教育目的,而不是为了实际练习。

运行
clang
后,
ldd a.out
的输出是什么?@richardfarn,对不起!这是错误的复制/粘贴。我发现了一个重复的问题:而且这个问题:无论如何,谷歌在我搜索时并没有为我透露它们,所以我认为我的问题也可以保留在这里。
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)