lua-users home
lua-l archive

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

Vaughan McAlley wrote:
Thank you. I've left out lua.c and luac.c, and the multiple mains
problem is gone. It still appears to import lualib.h and lauxlib.h but
then says luaL_newstate() is an undefined symbol.

The only thing I can think of is that luaL_newstate() isn't being exported because LUALIB_API isn't properly defined for your platform. I can see how that might happen when you drag a bunch of *.c files into your project without surrounding infrastructure like the makefile :). Maybe you're going about this the wrong way? Though I don't use Xcode nor own a Mac, I found the following post [1] from someone who got things working:

> I have Lua embedded in my current project. I just built Lua with the
> standard makefile, as far as I remember. That installed it in
> /usr/local/ from where you can just use '#include "lua.h"' and import
> "lua.a" into your project.

That is, having the proper tools installed (GCC), you would download the official lua-5.1.3.tar.gz, unpack it, open a terminal in the unpacked lua-5.1.3 directory and run the command `make macosx install`. Have you tried or considered this approach?

 - Peter Odding