Linux build tshark 1.10.7在luaL_openlibs上失败

Linux build tshark 1.10.7在luaL_openlibs上失败,linux,lua,wireshark,tshark,slackware,Linux,Lua,Wireshark,Tshark,Slackware,我想构建一个支持lua的tshark 1.10.7 x86精简版 我目前使用的选项包括: /configure --disable-wireshark --disable-packet-editor --disable-editcap --disable-mergecap --disable-reordercap --disable-text2pcap --disable-dftest --disable-randpkt --disable-a

我想构建一个支持lua的tshark 1.10.7 x86精简版

我目前使用的选项包括:

/configure --disable-wireshark --disable-packet-editor --disable-editcap --disable-mergecap       --disable-reordercap    --disable-text2pcap     --disable-dftest        --disable-randpkt       --disable-airpcap       --disable-dumpcap       --disable-rawshark --disable-ipv6 --with-gnutls=no --with-gcrypt=no --disable-glibtest --with-lua=/usr/local/lib/
测试的不同方法:

--with-lua=/usr/local
--with-lua=/usr/local/src/lua-5.2.3
--disable-usr-local (just in case i did miss some lua header file somewhere)
当我设置'--with lua=no'时,它构建得很好,以前也是这样使用的

以下是来自上述命令的错误日志:

checking whether to use liblua for the Lua scripting plugin... yes
checking Lua version... Lua 5.2
checking lua.h usability... yes
checking lua.h presence... yes
checking for lua.h... yes
checking lualib.h usability... yes
checking lualib.h presence... yes
checking for lualib.h... yes
checking lauxlib.h usability... yes
checking lauxlib.h presence... yes
checking for lauxlib.h... yes
checking for luaL_openlibs in -llua... no
checking for luaL_openlibs in -llua5.2... no
configure: error: Linking with liblua failed.
我确实从sorce lua.org安装了lua 5.2.3

由于slackware似乎需要重新链接readline libncurses,我对Lua5.2.3也做了同样的操作,以便正确编译它

make linux MYLIBS=-lncurses
Lua似乎至少指出了正确的版本:

# lua -v
Lua 5.2.3  Copyright (C) 1994-2013 Lua.org, PUC-Rio
以下是我的lua文件的位置:

bash-4.1# find /usr/local/include/ -iname "lu*"
/usr/local/include/lualib.h
/usr/local/include/lua.hpp
/usr/local/include/lua.h
/usr/local/include/luaconf.h
bash-4.1# find /usr/local/bin/ -iname "lu*"
/usr/local/bin/luac
/usr/local/bin/lua
bash-4.1# ls /usr/local/lib/liblua*
/usr/local/lib/liblua.a
安装本身是从/usr/local/src/lua-5.2.3完成的/

我尝试了不同的includedirs,检查了头文件所在的位置,再次删除了lua,重新安装了slackware 13.37,但似乎在相同的值上仍然失败

谷歌只向我展示了几个与我的问题不匹配的链接。 可能的相关链接 没有解决问题,因为这可能是一个构建错误

不同的搜索字符串似乎大多与缺少头文件、缺少lua或readline问题有关,我想我已经排除了这一点

根据评论,我做了一些进一步的解释(尚未完成)

config.log的输出清楚地显示了lualib.h lua.h是否存在

以下是我认为相关的部分:

configure:31529: checking for luaL_openlibs in -llua                                                                                                                                                                                                                                                                   
configure:31554: gcc -o conftest -g -O2 -Wall -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wpointer-arith -Wno-pointer-sign -Warray-bounds -Wcast-align -Wformat-security -Wold-style-definition -Wstrict-prototypes -Wjump-misses-init -Wvla -Waddress -Warray-bounds -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wwrite-strings -Wno-long-long -Wc++-compat -Wshadow -Wlogical-op -fexcess-precision=fast -fvisibility=hidden -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -DG_DISABLE_SINGLE_INCLUDES  -D_FORTIFY_SOURCE=0 -I/usr/local/include -I/usr/include -I/usr/local/lib//include  -Wl,--as-needed -L/usr/local/lib -L/usr/local/lib//lib conftest.c -llua  -lz  -L/usr/local/lib//lib -llua -lm  -lm >&5                                                                                                                                                                                     
conftest.c:63:1: warning: function declaration isn't a prototype                                                                                                                                                                                                                                                       
conftest.c:65:1: warning: function declaration isn't a prototype                                                                                                                                                                                                                                                       
conftest.c: In function 'main':                                                                                                                                                                                                                                                                                        
conftest.c:65:1: warning: old-style function definition                                                                                                                                                                                                                                                                
/usr/local/lib/liblua.a(loadlib.o): In function `ll_loadfunc':                                                                                                                                                                                                                                                         
loadlib.c:(.text+0x7f7): undefined reference to `dlsym'                                                                                                                                                                                                                                                                
loadlib.c:(.text+0x857): undefined reference to `dlopen'
loadlib.c:(.text+0x8d1): undefined reference to `dlerror'
loadlib.c:(.text+0x901): undefined reference to `dlerror'
/usr/local/lib/liblua.a(loadlib.o): In function `gctm':
loadlib.c:(.text+0xb78): undefined reference to `dlclose'
collect2: ld returned 1 exit status
configure:31554: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "wireshark"
| #define PACKAGE_TARNAME "wireshark"
| #define PACKAGE_VERSION "1.10.7"
| #define PACKAGE_STRING "wireshark 1.10.7"
| #define PACKAGE_BUGREPORT "http://bugs.wireshark.org/"
| #define PACKAGE_URL "http://www.wireshark.org/"
| #define PACKAGE "wireshark"
| #define VERSION "1.10.7"
| #define VERSION_MAJOR 1
| #define VERSION_MINOR 10
| #define VERSION_MICRO 7
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define YYTEXT_POINTER 1
| #define HTML_VIEWER "mozilla"
| #define _FILE_OFFSET_BITS 64
| #define HAVE_NL80211 1
| #define HAVE_NL80211_CMD_SET_CHANNEL 1
| #define _U_ __attribute__((unused))
| #define DATAFILE_DIR "/usr/local/share/wireshark"
| #define DOC_DIR "/usr/local/share/doc/wireshark"
| #define HAVE_GLIB_PRINTF_GROUPING 1
| #define HAVE_LIBPCAP 1
| #define HAVE_PCAP_OPEN_DEAD 1
| #define HAVE_PCAP_FREECODE 1
| #define HAVE_PCAP_BREAKLOOP 1
| #define HAVE_PCAP_FINDALLDEVS 1
| #define HAVE_PCAP_DATALINK_VAL_TO_NAME 1
| #define HAVE_PCAP_DATALINK_NAME_TO_VAL 1
| #define HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION 1
| #define HAVE_PCAP_LIST_DATALINKS 1
| #define HAVE_PCAP_SET_DATALINK 1
| #define HAVE_PCAP_LIB_VERSION 1
| #define HAVE_PCAP_GET_SELECTABLE_FD 1
| #define HAVE_PCAP_FREE_DATALINKS 1
| #define HAVE_PCAP_CREATE 1
| #define HAVE_BPF_IMAGE 1
| #define PCAP_NG_DEFAULT 1
| #define HAVE_LIBZ 1
| #define HAVE_INFLATEPRIME 1
| #define HAVE_LUA_H 1
| #define HAVE_LUALIB_H 1
| #define HAVE_LAUXLIB_H 1
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char luaL_openlibs ();
| int
| main ()
| {
| return luaL_openlibs ();
|   ;
|   return 0;
| }
configure:31563: result: no

现在,我将阅读更多内容,以了解警告并修复它们。

在sifflejoe的帮助下,我能够追踪到libdl检测在某种程度上无法完全工作

LDFLAGS="-ldl" ./configure --disable-wireshark --disable-packet-editor --disable-editcap --disable-mergecap       --disable-reordercap    --disable-text2pcap     --disable-dftest        --disable-randpkt       --disable-airpcap       --disable-dumpcap       --disable-rawshark --disable-ipv6 --with-gnutls=no --with-gcrypt=no --disable-glibtest --with-lua=/usr/local/lib/

确实为我们解决了这个问题。

尝试
--使用lua=/usr/local
。输入lua源文件的路径谢谢您的评论--使用lua=/usr/local没有帮助。添加--lua=/usr/local/src/lua-5.2.3也应该是
/usr/local/lib/liblua.a
(和
--使用lua=/usr/local
)。似乎您的Lua安装已损坏…@siffiejoe看起来libdl检测没有完全工作。LDFLAGS=“-ldl”。/configure。。。他确实解决了这个问题。请随意回答我可以接受的问题。