undefined reference to clock_gettime with -lrt

Hi,

I am trying to compile a C file with the following command:
gcc simple.c -I /usr/local/bin/maple15/extern/include -L/usr/local/bin/maple15/bin.IBM_INTEL_LINUX -o simple -lmaplec -lmaple -lhf -lprocessor32 -lrt

I get the error:
/usr/local/bin/maple15/bin.IBM_INTEL_LINUX/libmaple.so: undefined reference to `clock_gettime'
collect2: ld returned 1 exit status

Why do I get an undefined reference to clock_gettime? I do have -lrt as an option to gcc. The other -l are maple related.

I am compiling under Kubuntu 11.10, 32bits.

Regrads,
Remus.
You need to put the -lrt before the -lmaple when compiling.
Silly, no?

PS. If that isn't the problem, then you need to go visit a Kubuntu developer forum, alas.
I changed the order (-lrt before -lmaple) and I get the same error.

The developers from Maple told me to do this sequence:
MAPLE=/usr/local/bin/maple15
export LD_LIBRARY_PATH=$MAPLE/bin.IBM_INTEL_LINUX

gcc simple.c -I$MAPLE/extern/include -L$MAPLE/bin.IBM_INTEL_LINUX -o simple -lmaplec -lrt

and I get the same error... I think it's related to my Linux distribution (Kubuntu 11.10, 32bits).
Yes, in that case you'll have to go visit the Kubuntu forums. Sorry.
Topic archived. No new replies allowed.