Subject: undefined reference to `clock_gettime' (again)

undefined reference to `clock_gettime' (again)

From: Bram Matthys (Syzop) <syzop_at_vulnscan.org>
Date: Sun, 14 Dec 2008 14:49:06 +0100

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm upgrading to c-ares 1.6.0 and I'm encountering the following issue
(which has been posted before and then was supposed to be fixed I think):

gcc -I../include -I/home/syzop/Unreal3.2/extras/regexp/include
- -I/home/syzop/Unreal3.2/extras/c-ares/include -L../extras/c-ares/lib -pipe
- -g -fno-inline -Wall -Wno-strict-aliasing -Wno-unused -Wno-char-subscripts
- -Wno-format-zero-length -fstack-protector-all -Wstack-protector -DNOCLOSEFD
- -funsigned-char -fno-strict-aliasing -Wno-pointer-sign -DZIP_LINKS
- -export-dynamic -o ircd timesynch.o res.o s_bsd.o auth.o aln.o channel.o
cloak.o crule.o dbuf.o events.o fdlist.o hash.o help.o ircd.o ircsprintf.o
list.o lusers.o match.o modules.o packet.o parse.o s_auth.o s_conf.o
s_debug.o s_err.o s_extra.o s_kline.o s_misc.o s_numeric.o s_serv.o s_svs.o
 socket.o ssl.o s_user.o charsys.o scache.o send.o support.o umodes.o
version.o whowas.o zip.o cidr.o random.o extcmodes.o extbans.o md5.o
api-isupport.o api-command.o -lcrypt -lnsl -lz -ldl
- -L/home/syzop/Unreal3.2/extras/regexp/lib -ltre
- -L/home/syzop/Unreal3.2/extras/c-ares/lib -lcares
../extras/c-ares/lib/libcares.a(ares__timeval.o): In function `ares__tvnow':
ares__timeval.c:(.text+0x23): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status

I've already made the ircd use pkg-config to grab the libs, but it seems
c-ares doesn't provide them all, so it's not of much use then:

syzop_at_vulnscan:~/Unreal3.2/extras/c-ares-1.6.0$ pkg-config --libs libcares.pc
- -L/home/syzop/Unreal3.2/extras/c-ares/lib -lcares

How come it doesn't show -lrt with pkg-config ?

If I add -lrt manually to my libs the ircd uses, then the ircd compiles fine.

Is there an oversight on my end (could be, I'm not really into pkg-config),
or is there really a bug in c-ares?

Thanks in advance,

        Bram.

PS: The only ./configure option I use is --prefix, nothing else.

- --
Bram Matthys
Software developer/IT consultant syzop_at_vulnscan.org
PGP key: www.vulnscan.org/pubkey.asc
PGP fp: 8DD4 437E 9BA8 09AA 0A8D 1811 E1C3 D65F E6ED 2AA2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)

iD8DBQFJRQ7S46ioc5305a8RAhIFAJ98BqSLxMHpPxEtUyb7bmbRSgQAtQCfVIrC
9i4BDxl0Ggt9c0V67P+g9po=
=8ioz
-----END PGP SIGNATURE-----
Received on 2008-12-14