Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
undefined reference to `clock_gettime'
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
ganeshp
n00b
n00b


Joined: 13 Apr 2007
Posts: 10

PostPosted: Mon Jun 11, 2007 6:23 am    Post subject: undefined reference to `clock_gettime' Reply with quote

Below given program produces error:
try.c:(.text+0xf): undefined reference to `clock_gettime'

Please can anybody , tell me how to get this compiled successfully!!!
I am using PGi compiler i.e pgcc to compile this!!!!

1 #include <time.h>
2 #include <stdio.h>
3
4 int main(int argc, char * argv[])
5 {
6
7 // get starting time
8 struct timespec stop;
9 clock_gettime(CLOCK_REALTIME,&stop);
10
11 return 0;
12 }
Back to top
View user's profile Send private message
crazycat
l33t
l33t


Joined: 26 Aug 2003
Posts: 838
Location: Hamburg, Germany

PostPosted: Mon Jun 11, 2007 7:24 am    Post subject: Reply with quote

i answered you in another thread, you need -lrt gcc switch
Back to top
View user's profile Send private message
mark_alec
Bodhisattva
Bodhisattva


Joined: 11 Sep 2004
Posts: 6066
Location: Melbourne, Australia

PostPosted: Mon Jun 11, 2007 7:27 am    Post subject: Reply with quote

Moved from Other Things Gentoo to Duplicate Threads.

Crosspost of https://forums.gentoo.org/viewtopic-p-4098495-highlight-.html#4098495
_________________
www.gentoo.org.au || #gentoo-au
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum