[英]Getting undefined reference to 'clock_gettime' error, for curl program
Gretings,问候,
I have cross compile, OpenSSl , libssh2 and finally cURL, Don't know why it has generated only static library.我有交叉编译、 OpenSSl 、 libssh2 和最后 cURL,不知道为什么它只生成静态库。 Anyway I tried to run sample ftpget.c program by linking all the three libraries but I am getting the following error :
无论如何,我尝试通过链接所有三个库来运行示例 ftpget.c 程序,但出现以下错误:
.../libcurl.a(timeval.o): In function 'curlx_tvnow':
timeval.c:(.text+0xfc): undefined reference to 'clock_gettime'
collect2: ld return 1 exit status
make: *** [all] Error 1
Please help me resolve this error, Is there need to cross-compile any other library also ?请帮我解决这个错误,是否还需要交叉编译任何其他库?
Thanks, Yuvi谢谢,尤维
尝试与 librt ( -lrt
) 链接。
You need to link with the real-time library.您需要与实时库链接。
Use -lrt
使用
-lrt
gcc ... -lrt ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.