View previous topic :: View next topic |
Author |
Message |
ganeshp n00b
Joined: 13 Apr 2007 Posts: 10
|
Posted: Mon Jun 11, 2007 6:23 am Post subject: undefined reference to `clock_gettime' |
|
|
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 |
|
|
crazycat l33t
Joined: 26 Aug 2003 Posts: 838 Location: Hamburg, Germany
|
Posted: Mon Jun 11, 2007 7:24 am Post subject: |
|
|
i answered you in another thread, you need -lrt gcc switch |
|
Back to top |
|
|
mark_alec Bodhisattva
Joined: 11 Sep 2004 Posts: 6066 Location: Melbourne, Australia
|
|
Back to top |
|
|
|