我正在使用这样的程序,其中使用了 math.h 函数“sin”和 stdio.h 函数“printf”
#include <stdio.h>
#include <math.h>
int main ()
{
int x = sin(14);
printf("hello");
return 0;
}
正如 ehemient 所说, libc.so 和 libm.so(用于数学函数)应该已经与程序链接,尽管当我使用打印的选项“-L”在目标文件上运行 otool(类似于 objdump)时使用的共享库,没有 libc.so 或 libm.so 被打印出来
otool -L com_ex1.o
那么这是什么原因呢?我使用 otool 错了吗?或者那些库不应该显示为共享库?