title: Where did lua_pcall go? (Lua 5.2.0 on OSX Lion)
body: <p>Problem:</p>
  
  <pre><code>$ clang++ -L../lib/osx/ -I../include/ -o test Script.cpp Main.cpp Verbose.cpp -llua -lUnitTest++
  Undefined symbols for architecture x86_64:
    "_lua_pcall", referenced from:
        LuaSystem::dostring(char const*) in Script-EgY0dM.o
       (maybe you meant: _lua_pcallk)
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>Let's look at my lua build:</p>
  
  <pre><code>$ cd src/
  stevenlu443@steven-mba(Jun 09 02:41:58)[~/Downloads/lua-5.2.0/src]
  $ ls
  Makefile   lcorolib.c ldump.o    llex.o     lopcodes.o ltable.c   luac.c
  lapi.c     lcorolib.o lfunc.c    llimits.h  loslib.c   ltable.h   luac.o
  lapi.h     lctype.c   lfunc.h    lmathlib.c loslib.o   ltable.o   luaconf.h
  lapi.o     lctype.h   lfunc.o    lmathlib.o lparser.c  ltablib.c  lualib.h
  lauxlib.c  lctype.o   lgc.c      lmem.c     lparser.h  ltablib.o  lundump.c
  lauxlib.h  ldblib.c   lgc.h      lmem.h     lparser.o  ltm.c      lundump.h
  lauxlib.o  ldblib.o   lgc.o      lmem.o     lstate.c   ltm.h      lundump.o
  lbaselib.c ldebug.c   liblua.a   loadlib.c  lstate.h   ltm.o      lvm.c
  lbaselib.o ldebug.h   linit.c    loadlib.o  lstate.o   lua        lvm.h
  lbitlib.c  ldebug.o   linit.o    lobject.c  lstring.c  lua.c      lvm.o
  lbitlib.o  ldo.c      liolib.c   lobject.h  lstring.h  lua.h      lzio.c
  lcode.c    ldo.h      liolib.o   lobject.o  lstring.o  lua.hpp    lzio.h
  lcode.h    ldo.o      llex.c     lopcodes.c lstrlib.c  lua.o      lzio.o
  lcode.o    ldump.c    llex.h     lopcodes.h lstrlib.o  luac
  stevenlu443@steven-mba(Jun 09 02:41:59)[~/Downloads/lua-5.2.0/src]
  $ nm liblua.a | grep _lua_pcall
  115:0000000000001a30 T _lua_pcallk
  116:0000000000003b40 S _lua_pcallk.eh
  1563:                 U _lua_pcallk
  1839:                 U _lua_pcallk
  stevenlu443@steven-mba(Jun 09 02:42:12)[~/Downloads/lua-5.2.0/src]
  $ nm *.o | grep _lua_pcall
  115:0000000000001a30 T _lua_pcallk
  116:0000000000003b40 S _lua_pcallk.eh
  597:                 U _lua_pcallk
  977:                 U _lua_pcallk
  2630:                 U _lua_pcallk
  2760:                 U _lua_pcallk
  </code></pre>
  
  <p>Why does <code>_lua_pcall</code> not exist? The 5.2 doc seems to say pcallk does the same as pcall but has the benefit of being able to yield but pcall should still be available...</p>
  
  <p>UPDATE: I just realized I am trying to link to 5.2 using older (5.1?) headers... Does anybody know where there is a list that says which headers are necessary? I don't need all the headers from the Lua source. </p>
  
  <p>We can infer from what we've seen here that in 5.2 pcall is implemented using <code>_lua_pcallk</code>.</p>