使用最近的 luaJITlua_open
返回null
。常规 lua 库不会发生这种情况。
lua_State *L = lua_open();
std::cout << L << std::endl;
输出:0x0
我怎样才能让 luaJIT 工作?
SSCCE:
#include <iostream>
#include <luajit-2.0/lua.hpp>
//linked library: libluajit-5.1.a
int main(int argc, const char * argv[])
{
lua_State *L = luaL_newstate(); // lua_open();
std::cout << L << std::endl; // 0x0
}
附加信息:使用make
和make install
. 使用编译器:
$ cc --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
(使用 luajit 命令行应用程序luajit
工作正常,测试脚本执行时没有错误。)