   Issues with lua on mac os x
  Hi, I’ve been trying to get lua to work with c++ on my intel mac in xcodes. So I downloaded the source from lua’s website (“http://www.lua.org/download.html”) and installed it via the command line using.cd /path were i downloaded itmake macosxsudo make installEverything seemed to work so I tried to compile some code that i found on the internet to test to see if it was working. (http://gamedevgeek.com/tutorials/getting-started-with-lua/)#include <stdio.h>extern "C" {#include "lua.h"#include "lualib.h"#include "lauxlib.h"}/* the Lua interpreter */lua_State* L;int main ( int argc, char *argv[] ){/* initialize Lua */L = lua_open();/* load Lua base libraries */luaL_openlibs(L);/* run the script */luaL_dofile(L, "test.lua");/* cleanup Lua */lua_close(L);/* pause */printf( "Press enter to exit..." );getchar();return 0;}The file test.lua simply contained.print “Hello, World!”When i tried to build this i got a bunch of errors saying that the compiler couldn’t find lua.h, lualib.h, and luaxlib.h so i changed them toextern “C" {#include “/usr/local/include/lua.h"#include “/usr/local/include/lualib.h"#include “/usr/local/include/luaxlib.h}and that fixed the errors that were caused by the compiler not being able to find the files. But I’m still left with 5 errors that I can’t figure out."_luaL_loadfile", referenced from:_main in main.o"_luaL_newstate", referenced from:_main in main.o"_lua_close", referenced from: _main in main.o“_luaL_openlibs", referenced from:_main in main.o"_lua_pcall", referenced from:_main in main.old: symbol(s) not foundcollect2: ld returned 1 exit statusI don’t know what I’m doing wrong. Any help will be greatly appreciated.   
  You just haven't linked it. Presumable its built as a static lib, you just need to link it.I guess your lib is built and placed in :/usr/local/lib/lua.extensionI can't remember what static lib extensions are on the mac. Goto your xcode project (been a while since I've used xcode so I can't remember where exactly) and link the lib in.What you can do is put all the lua files into your project and along with your main source file and then it should all built and link fine.   ;Follow these instructions You need to edit the makefiles so that its built as a universal binary, then once the files have been made, drag the liblua.a static library (or whatever it calls it) along with the include files to your project and xcode should automatically link it.   ;  The lua makefile installs to /usr/local/ by default, which isn't in the compiler or linker paths.If you open up the inspector for the project node inside XCode, you can edit a number of compile and linker options, including the header and library search paths.Add /usr/local/include to the header search paths, and /usr/local/lib to the library search paths.Then navigate to /usr/local/lib in the Finder (press CMD-G while in the Finder to enter the path, since /usr is invisible), and drag liblua.a into the xcode file list, which will add it for linking.   