From: Steve Graegert <graegerts@gmail.com>
To: r_zaca <r_zaca@ig.com.br>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: Nanoseconds
Date: Wed, 24 Aug 2005 21:29:55 +0200 [thread overview]
Message-ID: <6a00c8d5050824122960395a1a@mail.gmail.com> (raw)
In-Reply-To: <20050824_190854_092976.r_zaca@ig.com.br>
On 8/24/05, r_zaca <r_zaca@ig.com.br> wrote:
> Hello all,
>
> I need a way to get the date of my linux machine in seconds and
> nanoseconds. In seconds I know I can you some of the standards function of
> lib C (that give me the date since the "epoch"), but my problem is to get
> the nanoseconds. I was reading about clock_gettime. It seems to solve my
> problem, but when I try to compile and link it, I get an error message like
> that:
>
> cc time.c -o time
> /tmp/ccOKP0zk.o(.text+0x21): In function `main':
> : undefined reference to `clock_gettime'
> collect2: ld returned 1 exit status
> make: *** [time] Error 1
>
> I know its a linker error, that is, the linker doesn't not know here to find
> this function.
> Doesn't this function belong to the standard gnu libc?
Yes, all the clock_* functions are in librt (/lib/librt.so.1) which is
part of glibc. Try linking against librt.
Regards
\Steve
--
Steve Graegert <graegerts@gmail.com>
Software Consultancy {C/C++ && Java && .NET}
Mobile: +49 (176) 21248869
Office: +49 (9131) 7126409
prev parent reply other threads:[~2005-08-24 19:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-24 19:08 Nanoseconds r_zaca
2005-08-24 19:29 ` Steve Graegert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6a00c8d5050824122960395a1a@mail.gmail.com \
--to=graegerts@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
--cc=r_zaca@ig.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).