lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I built the Lua libraries on Mandrake 9.0 with the standard makefile and
"make test" ran just fine. However, I am trying to use a minimal set of
files for integration into a program that runs on another system (where
installing libraries to standard locations is not possible), and to do
this I was just copying the include and lib directories, hoping to use
those in the compilation process. The compilation stage works just fine,
but the linking stage fails. Here's the command that my makefile emits:

gcc -lcrypt -o progname lua/lib/liblua.a lua/lib/liblualib.a first.o
second.o (...etc etc...)

lua/lib/liblua.a and lua/lib/liblualib.a are definitely valid paths (as
putting an invalid path in there gives me an error) and those libraries
seem to export all the symbols I would expect them to (when I checked
them with the 'nm' command) yet I get many errors such as "undefined
reference to `lua_gettop'" or "undefined reference to `lua_open'". I am
compiling in C, not C++, and the classic extern "C" thing that works for
many C++ programmers causes a compiler error (presumably because it's
not a valid feature in plain C).

Do I need something else on that command line? Or perhaps I need more
files than just the .a libraries in the lib directory? Any hints
gratefully received.

--
Ben Sizer
http://pages.eidosnet.co.uk/kylotan