[英]ld: library not found for -lrt
我正在嘗試運行一個已經制作並適用於Ubuntu但在Mac OS上運行的項目。 當我做make時,我收到以下錯誤:
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
我在Thole項目中看不到任何帶有該名稱的庫。
任何人都可以解釋它是什么以及如何解決它?
在舊的Linux系統上,記錄了幾個函數,例如clock_gettime
,需要-lrt
用於舊版本的GNU libc。 最近的 glibc就是這種情況(從2013年的2.17之后)。
因此,您可以從Makefile
刪除-lrt
(並從生成它的cmake
配置中刪除該東西)。
順便說一句,刪除-lrt
也應該適合最近的 Linux發行版。
PS。 如果您支持Linux系統,則應向您的支持部門尋求建議。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.