Yes you were partly right there. I could reproduce your problem. The thing is that Lua used gcc and Smaug used g++.
The only way I could make it work was to recompile Lua.
You can get Lua from:
http://www.lua.org/ftp/lua-5.1.5.tar.gz
I suggest staying away from Lua 5.2 because some of the things I used may have changed in Lua 5.2.
In the lua "src" directory (not the top-level directory) change in the Makefile:
# makefile for building Lua
# see ../INSTALL for installation instructions
# see ../Makefile and luaconf.h for further customization
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
PLAT= none
CC= gcc
CFLAGS= -O2 -Wall $(MYCFLAGS)
AR= ar rcu
RANLIB= ranlib
RM= rm -f
LIBS= -lm $(MYLIBS)
to:
# makefile for building Lua
# see ../INSTALL for installation instructions
# see ../Makefile and luaconf.h for further customization
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
PLAT= none
CC= g++
CFLAGS= -O2 -Wall $(MYCFLAGS)
AR= ar rcu
RANLIB= ranlib
RM= rm -f
LIBS= -lm $(MYLIBS)
Changed line in bold. Then do a "make clean" and a "make" (I used "make posix") followed by a "sudo make install". The "make install" needs to be done at the top-level directory, not the "src" one.
Having done that, make sure that
-llua is in your L_FLAGS in the Smaug Makefile, eg.
L_FLAGS = $(PROF) $(SOLARIS_LINK) -lz $(NEED_DL) -llua
Then it should link OK.
If you can't install Lua because you don't have rights, just link in the lualib.a file as part of the link step in Smaug.