isaura almar
isaura almar

Reputation: 466

ld: library not found for -lrt

I am trying to run a project that was made and works for Ubuntu but on Mac OS. And when I am doing the make I got the following error:

ld: library not found for -lrt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [consumer] Error 1
make[1]: *** [CMakeFiles/consumer.dir/all] Error 2
make: *** [all] Error 2

I can't see any library with that name at thole project.

Can anyone explain what it is and how to solve it?

Upvotes: 10

Views: 9404

Answers (1)

On old Linux systems, several functions, such as clock_gettime, are documented to need -lrt for old versions of GNU libc. This is no more the case on recent glibc (after 2.17 from 2013).

So you can remove -lrt from your Makefile (and remove the thing from your cmake configuration thing generating it).

BTW, removing -lrt should also fit for recent Linux distributions.

PS. If you are paying support for your Linux system, you should ask your support for advice.

Upvotes: 15

Related Questions