Article 4X2JT librt installed but not found in openwrt: /usr/bin/ld: cannot find -lrt

librt installed but not found in openwrt: /usr/bin/ld: cannot find -lrt

by
John-Marie
from LinuxQuestions.org on (#4X2JT)
I tried to compile a project that uses librt library. However, I get an error in the make phase indicating /usr/bin/ld: cannot find -lrt.

Code:/usr/bin/ld: cannot find -lrt
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1601: libmodsecurity.la] Error 1
make[3]: Leaving directory '/root/ModSecurity/src'
make[2]: *** [Makefile:3222: all-recursive] Error 1
make[2]: Leaving directory '/root/ModSecurity/src'
make[1]: *** [Makefile:1015: all] Error 2
make[1]: Leaving directory '/root/ModSecurity/src'
make: *** [Makefile:1025: all-recursive] Error 1At first, I tried to search for librt but I cannot find it in my system and when I perform

Code:opkg install librtCode:Package librt (1.1.24-2) installed in root is up to date.
I get librt is installed in root but I cannot find it.

As a second solution, I tried to modify the Makefile and compile the project without it. Specifically, I removed: LD=/usr/bin/ld and GLOBAL_LDADD= -lrt.

Code:GLOBAL_LDADD = -lrt
GREP = /bin/grep
INSTALL = ./install-sh -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LD = /usr/bin/ld
LDFLAGS = -L/usr/local/lib -lpcre
But I got the same error when I recompile the project.latest?d=yIl2AUoC8zA latest?i=8n5Z5T87wOo:IIM_wEa6zpk:F7zBnMy latest?i=8n5Z5T87wOo:IIM_wEa6zpk:V_sGLiP latest?d=qj6IDK7rITs latest?i=8n5Z5T87wOo:IIM_wEa6zpk:gIN9vFw8n5Z5T87wOo
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments