Thank you for your help Jason, as now I have the build completing and linking properly.
However, at runtime, I see a confuddling error that I was wondering if you encountered at some point?
Namely, the program throws an EXC_BAD_ACCESS error code at line 107 of the
CCLuaStack::init function. This is because
m_state is set to a NULL address after the call to
lua_open() below — lines 104-107 of cocos2dx_support/CCLuaStack.cpp:
m_state = lua_open();
By tracing this further, it seems like the null pointer is generated in the LuaJit memory allocation code in
While I removed the “-m32” tag in build_mac.sh to build the library for 64-bit deployment, I thought that this build alteration should not cause an error such as this one, though I may be wrong.
My questions for you, Jason, is:
1. Have you ever seen this issue at runtime?
2. Which version of LuaJIT are you using?
3. Are you building the LuaJIT archive as 32-bit or 64-bit?
Would love to hear your thoughts if you’re willing to share them! Hopefully one of these questions holds a key to the runtime errors.