作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我尝试构建以下程序时:
#include <stdio.h>
int main(void)
{
printf("hello world\n");
return 0;
}
在 OS X 10.6.4 上,具有以下标志:
gcc -static -o blah blah.c
它返回:
ld: library not found for -lcrt0.o
collect2: ld returned 1 exit status
还有其他人遇到过这种情况吗,或者其他人还没有受到过影响吗?有修复吗?
谢谢
最佳答案
这行不通。从 gcc
的 man
页面:
This option will not work on Mac OS X unless all libraries (including libgcc.a) have also been compiled with -static. Since neither a static version of libSystem.dylib nor crt0.o are provided, this option is not useful to most people.
关于macos - ld:在带有 gcc/clang -static 标志的 OSX 10.6 上找不到 -lcrt0.o 的库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3801011/
我是一名优秀的程序员,十分优秀!