对于curl程序,获取对"clock_gettime"错误的未定义引用 [英] Getting undefined reference to 'clock_gettime' error, for curl program
本文介绍了对于curl程序,获取对"clock_gettime"错误的未定义引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
礼物,
我已经交叉编译了OpenSSl,libssh2和最后的cURL,不知道为什么它只生成静态库.无论如何,我试图通过链接所有三个库来运行示例ftpget.c程序,但出现以下错误:
I have cross compile, OpenSSl , libssh2 and finally cURL, Don't know why it has generated only static library. Anyway I tried to run sample ftpget.c program by linking all the three libraries but I am getting the following error :
.../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 ?
谢谢, Yuvi
推荐答案
尝试与librt(-lrt
)链接.
Try linking with librt (-lrt
).
这篇关于对于curl程序,获取对"clock_gettime"错误的未定义引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文