lua-users home
lua-l archive

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


I'm running Mac OS 10.5.5 and Using Xcode 3.1.1 and Lua 5.1.4. I'm trying to embed Lua into my C++ application. When I build it, at the linker stage I get the following errors:

  "lua_pcall(lua_State*, int, int, int)", referenced from:
      vConsole::run()     in main.o
  "luaL_newstate()", referenced from:
      initVLua()    in main.o
  "luaL_openlibs(lua_State*)", referenced from:
      initVLua()    in main.o
  "lua_close(lua_State*)", referenced from:
      vEngine::~vEngine()in main.o
  "luaL_loadstring(lua_State*, char const*)", referenced from:
      vConsole::run()     in main.o

Xcode should be linking against liblua.a, and I've tried using different versions, all of which give me the same errors. My (relevant) project code looks like this:

#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
...
static lua_State* LUA;
...
LUA = lua_open();
luaL_openlibs(LUA);
...
luaL_loadstring(LUA, comstr);
lua_pcall(LUA, 0, 0, 0);
...
lua_close(LUA);

I googled for about an hour looking for a solution and it's really driving me crazy. If anyone could help out, I would greatly appreciate it. Thanks.

If you want the whole command, it's here:

/Developer/usr/bin/g++-4.0 -arch i386 -L/Users/etherous/Documents/Venus/build/Release -L/usr/local/lib -L/usr/local/lib/lua/5.1 "-L/Users/etherous/Documents/Venus/../Irrlicht/IrrLicht MacOSX 1.0/lib/Mac OS X" -L/Users/etherous/Documents/Venus -L/sw/lib -L/usr/local/lib/lua/5.1 -F/Users/etherous/Documents/Venus/build/Release -filelist /Users/etherous/Documents/Venus/build/Venus.build/Release/Venus.build/Objects-normal/i386/Venus.LinkFileList -framework Carbon -framework Carbon -framework AppKit -framework Cocoa -framework OpenAL -framework OpenGL -framework GLUT -framework Python -lIrrlicht -llua -o /Users/etherous/Documents/Venus/build/Release/Venus.app/Contents/MacOS/Venus