简体   繁体   English

编译Lua时“找不到-lreadline”错误

[英]“cannot find -lreadline” error when compiling Lua

This should be a pretty straightforward issue -- I'm trying to compile Lua (or rather lua-vec, which is a minor variant) on a CentOS Linux install, and I get the following error: 这应该是一个非常简单的问题 - 我正在尝试在CentOS Linux安装上编译Lua(或者更确切地说是lua-vec,这是一个小变体),我收到以下错误:

[jt@flyboy src]#make linux
make all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
make[1]: Entering directory `/jt/flyboy/fly/lua/lua-vec/src'
gcc -o lua  lua.o liblua.a -lm -Wl,-E -ldl -lreadline -lhistory -lncurses
/usr/bin/ld: cannot find -lreadline
collect2: ld returned 1 exit status
make[1]: *** [lua] Error 1

That would suggest the readline lib is not installed. 这表明没有安装readline lib。 But... 但...

[jt@flyboy src]#ls /usr/lib/libreadline*
/usr/lib/libreadline.so.5  /usr/lib/libreadline.so.5.1

Interestingly, if I rearrange the order of readline/history/ncurses, whichever is first triggers the same error, so I suspect that this is some sort of a folder-specification problem, not a missing library problem. 有趣的是,如果我重新排列readline / history / ncurses的顺序,那么首先触发相同的错误,所以我怀疑这是某种文件夹规范问题,而不是缺少库问题。

Any ideas? 有任何想法吗?


yum install readline-devel.x86_64 readline-devel.i386 ncurses-devel.i386 ncurses-devel.x86_64  

seems to have done the trick! 似乎已经成功了! The odd thing is I have compiled this before without these libs... but enough time pondering life's mysteries... 奇怪的是我之前没有这些文件编译过这个...但是有足够的时间思考生活的神秘......

libreadline is not enough, it will give you libraries related to readline. libreadline是不够的,它会给你与readline相关的库。 You need libreadline-dev for compiling package which depends upon readline like in above case. 你需要libreadline-dev来编译包,它依赖于readline ,如上例所示。

In Red Hat like distros, name of package is readline-devel 在像发行版这样的Red Hat中,包的名称是readline-devel

Following command will do the trick in such environment: 以下命令将在这样的环境中完成:

$ yum install -y readline-devel

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 (Java)编译时出现“错误:找不到符号”? - (Java) “error: cannot find symbol” when compiling? ld:找不到…在群集中编译CAMB时出错(ifort编译器) - ld: cannot find … Error when compiling CAMB in a cluster (ifort compiler) 编译错误:在kubuntu linux中找不到-lGLU和-lGL - Compiling error: cannot find -lGLU and -lGL in kubuntu linux 编译C源代码时(不兼容的库)找不到-lagent - Cannot find -lagent when compiling c source code (incompatible library) 交叉编译mips:链接器错误:找不到条目符号__start; - cross compiling mips: Linker error: cannot find entry symbol __start; Linux g ++编译错误:/ usr / bin / ld:找不到-l / usr / local / include - Linux g++ compiling error: /usr/bin/ld: cannot find -l/usr/local/include opencv pkg-config:使用g ++编译时找不到-lopencv_ts - opencv pkg-config: cannot find -lopencv_ts when compiling using g++ CentOS 7“在编译PHP 7时找不到imap库(libc-client.a)” - CentOS 7 “Cannot find imap library (libc-client.a)” when compiling PHP 7 “/usr/bin/ld: 在 Ubuntu 20.04 中编译 opencv 项目时找不到 -llibopencv_calib3d” - "/usr/bin/ld: cannot find -llibopencv_calib3d" when compiling an opencv project in Ubuntu 20.04 NVCC CUDA 交叉编译找不到“-lcudart” - NVCC CUDA cross compiling cannot find “-lcudart”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM