tracebox / tracebox

Tracebox, a middlebox detection tool
http://www.tracebox.org
GNU General Public License v2.0
166 stars 28 forks source link

make error: lua/tracebox-lua_utils.o #35

Closed heul closed 9 years ago

heul commented 9 years ago

Maybe I'm to stupid, but I cannot get it to compile. During Make:

make[3]: Entering directory `/path/to/tracebox/src/tracebox'
g++ -DPACKAGE_NAME=\"tracebox\" -DPACKAGE_TARNAME=\"tracebox\" -DPACKAGE_VERSION=\"0.3\" -DPACKAGE_STRING=\"tracebox\ 0.3\" -DPACKAGE_BUGREPORT=\"olivier.tilmans@uclouvain.be\" -DPACKAGE_URL=\"http://tracebox.org\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSTDC_HEADERS=1 -DHAVE_LUA_H=1 -DHAVE_LUALIB_H=1 -DHAVE_LAUXLIB_H=1 -DHAVE_LUACONF_H=1 -DHAVE_JSONC=1 -DHAVE_LIBJSON=1 -I.  -I../../noinst/libcrafter/libcrafter -I/usr/include/lua5.1 -I/usr/include/pcap  -fno-omit-frame-pointer -Wall   -g -O2 -std=gnu++11 -MT lua/tracebox-lua_utils.o -MD -MP -MF lua/.deps/tracebox-lua_utils.Tpo -c -o lua/tracebox-lua_utils.o `test -f 'lua/lua_utils.cpp' || echo './'`lua/lua_utils.cpp
lua/lua_utils.cpp: In function ‘void stackDump(lua_State*, const char*, size_t, std::ostream&)’:
lua/lua_utils.cpp:48:23: error: ‘lua_pushglobaltable’ was not declared in this scope
  lua_pushglobaltable(L);
                       ^
make[3]: *** [lua/tracebox-lua_utils.o] Error 1
make[3]: Leaving directory `/path/to/tracebox/src/tracebox'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/path/to/tracebox/src/tracebox'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/path/to/tracebox/src'
make: *** [all-recursive] Error 1

On Debian Wheezy with lua5.1

oliviertilmans commented 9 years ago

Hello, This appears to be a feature from Lua5.2. I'll write the compatibility shim for that this weekend.

oliviertilmans commented 9 years ago

Hello,

Could you try again, when using the branch lua_compat?

$ git checkout lua_compat
$ autoreconf --force --install
$ ./configure [your additional directives]
$ make -j4
[$ sudo make install] (if you don't install, the executable is located under src/tracebox/tracebox)

Normally this should work (tested on my machine and Lua 5.1.5)

c92xteaj commented 9 years ago

Hi Olivier,

I can confirm, that the fix worked. Within branch lua_comat the build finished successfully with Lua 5.1.4.

Cheers and thanks -- Thomas

heul commented 9 years ago

First of all, thank you so much! I also had an error with lua 5.2, that disappeared as well with the lua_compat branch :

libtool: link: g++ -g -O2 -std=gnu++11 -o tracebox tracebox-tracebox.o tracebox-lua.o tracebox-PartialHeader.o tracebox-PacketModification.o lua/tracebox-lua_base.o lua/tracebox-lua_crafter.o lua/tracebox-lua_arg.o lua/tracebox-lua_fwfilter.o lua/tracebox-lua_icmp.o lua/tracebox-lua_init.o lua/tracebox-lua_ip.o lua/tracebox-lua_ipoption.o lua/tracebox-lua_ipv6.o lua/tracebox-lua_ipv6segmentroutingheader.o lua/tracebox-lua_packetmodifications.o lua/tracebox-lua_packet.o lua/tracebox-lua_raw.o lua/tracebox-lua_tcp.o lua/tracebox-lua_tcpoption.o lua/tracebox-lua_udp.o lua/tracebox-lua_tracebox.o lua/tracebox-lua_utils.o lua/tracebox-lua_dns.o lua/tracebox-lua_tcptimestamp.o  /path/to/tracebox/noinst/libcrafter/libcrafter/.libs/libcrafter.a -lresolv -lrt -lpthread -llua5.2 -lm -ldl -lpcap -ljson-c
tracebox-lua.o: In function `script_packet(std::string&)':
/path/to/tracebox/src/tracebox/lua.cc:21: undefined reference to `lua_pcall'
tracebox-lua.o: In function `script_exec(char const*, int, char**)':
/path/to/tracebox/src/tracebox/lua.cc:53: undefined reference to `lua_pcall'
tracebox-lua.o: In function `script_execfile(char const*, int, char**)':
/path/to/tracebox/src/tracebox/lua.cc:69: undefined reference to `luaL_loadfile'
/path/to/tracebox/src/tracebox/lua.cc:72: undefined reference to `lua_pcall'
/path/to/tracebox/src/tracebox/lua.cc:75: undefined reference to `lua_tointeger'
lua/tracebox-lua_base.o: In function `l_do(lua_State*, char const*)':
/path/to/tracebox/src/tracebox/lua/lua_base.cpp:39: undefined reference to `lua_pcall'
lua/tracebox-lua_base.o: In function `lua_traceback(lua_State*)':
/path/to/tracebox/src/tracebox/lua/lua_base.cpp:106: undefined reference to `lua_call'
lua/tracebox-lua_arg.o: In function `v_arg_integer_get_':
/path/to/tracebox/src/tracebox/lua/lua_arg.cpp:74: undefined reference to `lua_tointeger'
lua/tracebox-lua_arg.o: In function `v_arg_double_get_':
/path/to/tracebox/src/tracebox/lua/lua_arg.cpp:132: undefined reference to `lua_tonumber'
lua/tracebox-lua_ipv6segmentroutingheader.o: In function `l_IPv6SegmentRoutingHeader_SetHMAC_(Crafter::IPv6SegmentRoutingHeader*, lua_State*)':
/path/to/tracebox/src/tracebox/lua/lua_ipv6segmentroutingheader.cpp:180: undefined reference to `lua_tointeger'
lua/tracebox-lua_ipv6segmentroutingheader.o: In function `l_IPv6SegmentRoutingHeader_SetPolicyList_(Crafter::IPv6SegmentRoutingHeader*, lua_State*)':
/path/to/tracebox/src/tracebox/lua/lua_ipv6segmentroutingheader.cpp:110: undefined reference to `lua_tointeger'
lua/tracebox-lua_raw.o: In function `l_raw_ref::l_bytes(lua_State*)':
/path/to/tracebox/src/tracebox/lua/lua_raw.cpp:80: undefined reference to `lua_tointeger'
lua/tracebox-lua_tracebox.o: In function `tCallback':
/path/to/tracebox/src/tracebox/lua/lua_tracebox.cpp:99: undefined reference to `lua_pcall'
/path/to/tracebox/src/tracebox/lua/lua_tracebox.cpp:110: undefined reference to `lua_tonumber'
collect2: error: ld returned 1 exit status
make[3]: *** [tracebox] Error 1
make[3]: Leaving directory `/path/to/tracebox/src/tracebox'

Anyways, now it works like a charm.