I have a bit of code which used pthread_cond_wait
which looks like this:
struct timespec ts;
clock_getttime(CLOCK_REALTIME, &timS);
ts.tv_sec += delay;
pthread_mutex_lock(&a_mutex);
pthread_cond_timedwait(&thread_cond, &a_mutex,&timS);
pthread_mutex_unlock(&a_mutex);
But I get a linker error on compilation,
undefined symbol clock_gettime ... first referenced in (the file with that code)
This is the only linker error I get; if I comment out this block of code it compiles, so the pthread library is loading. I read somewhere that I need the -lc flag set, which I have done but it appears that I need to set something else too.
Does anybody know what?
This is on Solaris 10, using Sun's 5.8 compiler.