Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 445
isaura almar Avatar asked Dec 07 '17 20:12

isaura almar


1 Answers

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.

like image 89
Basile Starynkevitch Avatar answered Nov 18 '22 23:11

Basile Starynkevitch