Linker error when building project submodules: /usr/bin/ld: cannot find -lreadline
tsilia opened this issue · 2 comments
tsilia commented
Hello.
A linker error occurs during building the project targets that use ravi
(GCC 9.4.0 on Ubuntu 20):
[ 21%] Linking C executable ravi_s
[ 22%] Linking C executable testravidebug
/usr/bin/ld: cannot find -lreadline
collect2: error: ld returned 1 exit status
make[2]: *** [Tests/ravi/CMakeFiles/ravi_s.dir/build.make:85: Tests/ravi/ravi_s] Error 1
make[1]: *** [CMakeFiles/Makefile2:2515: Tests/ravi/CMakeFiles/ravi_s.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: cannot find -lreadline
collect2: error: ld returned 1 exit status
make[2]: *** [Tests/ravi/CMakeFiles/testravidebug.dir/build.make:115: Tests/ravi/testravidebug] Error 1
make[1]: *** [CMakeFiles/Makefile2:2461: Tests/ravi/CMakeFiles/testravidebug.dir/all] Error 2
/usr/bin/ld: CMakeFiles/LuaBridgeTests52LuaCNoexcept_DynamicLibrary.dir/Lua/LuaLibrary5.2.4.c.o: in function `os_tmpname':
LuaLibrary5.2.4.c:(.text+0x9a79): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
[ 22%] Linking C executable ravidebug
[ 22%] Built target LuaBridgeTests52LuaCNoexcept_DynamicLibrary
[ 22%] Linking CXX shared library libLuaBridgeTests53LuaC_DynamicLibrary.so
/usr/bin/ld: cannot find -lreadline
collect2: error: ld returned 1 exit status
make[2]: *** [Tests/ravi/CMakeFiles/ravidebug.dir/build.make:115: Tests/ravi/ravidebug] Error 1
make[1]: *** [CMakeFiles/Makefile2:2488: Tests/ravi/CMakeFiles/ravidebug.dir/all] Error 2
/usr/bin/ld: CMakeFiles/LuaBridgeTests53LuaC_DynamicLibrary.dir/Lua/LuaLibrary5.3.6.c.o: in function `os_tmpname':
LuaLibrary5.3.6.c:(.text+0x9f5f): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
[ 22%] Built target LuaBridgeTests53LuaC_DynamicLibrary
Scanning dependencies of target liblua-static
[ 22%] Linking C shared library libravi.so
/usr/bin/ld: cannot find -lreadline
collect2: error: ld returned 1 exit status
make[2]: *** [Tests/ravi/CMakeFiles/libravi.dir/build.make:701: Tests/ravi/libravi.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:2599: Tests/ravi/CMakeFiles/libravi.dir/all] Error 2
Looks like the build script won't check all necessary dependencies at the configure stage. I had to install the libreadline-dev package, which solved the issue for me.
kunitoki commented
Libreadline seems to be mandatory to compile ravi. Please report upstream, this is not a luabridge3 issue
tsilia commented
Oh, ok. Will do. Thanks!