小白问下,怎么知道用到的函数需要连接什么库?
小白问下,怎么知道用到的函数需要连接什么库?
经常用到一些函数,找不到定义,又不知道怎么找有时候查man也查不到,请问有什么办法知道函数用的什么库吗?比如clock(),gettimeofday()
[解决办法]
我目前用的eclipse+c插件,挺好用的,就算你没有include,也依旧可以ctrl+右键点过去,然后就知道了。当然查资料应该还是有的吧,这是我目前的笨办法
[解决办法]
ubuntu下用man命令就能查看到。
比如man gettimeofday
NAME
gettimeofday, settimeofday -- get/set date and time
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/time.h>
int
gettimeofday(struct timeval *tp, struct timezone *tzp);
int
settimeofday(const struct timeval *tp, const struct timezone *tzp);
DESCRIPTION
Note: timezone is no longer used; this information is kept outside the
kernel.
别的linux下应该也写了使用哪个库的吧。你看看。
[解决办法]