문제

I have no problems with LuaJIT, it great and easy to switch from good old Lua.
But for now i use folder src from LuaJIT distribution as include for lib.
It is kinda messy because there are makefile, batch scripts, c files, dasc files, src/jit folder with scripts which i know used with luajit.exe e.t.c.
I want to create clean include folder with only h files (and other if needed) for using LuaJIT in c++ windows application as shared lib, but quite don't know what to exclude.

My current exclude list

  • host folder
  • jit folder
  • c files
  • dasc files
  • c files
  • luajit.lib - goes to lib folder
  • luajit.exp
  • luajit.exe
  • luajit.dll - goes to bin folder
  • makefile
  • makefile.dep
  • bat files
도움이 되었습니까?

해결책

http://luajit.org/install.html

It's strongly suggested to build LuaJIT separately using the supplied build system. Please do not attempt to integrate the individual source files into your build tree. You'll most likely get the internal build dependencies wrong or mess up the compiler flags. Treat LuaJIT like any other external library and link your application with either the dynamic or static library, depending on your needs.

Build as usual and then copy into your project the files:

  • lua.h, lauxlib.h, lualib.h, luajit.h, luaconf.h;
  • libluajit-5.1.a, or luajit-5.1.dll, or libluajit-5.1.x.x.x.dylib or whatever your platform static/shared library file looks like;
  • #include headers in project sources and link executables to the library file;

다른 팁

LuaJIT is ABI compatible with Lua, so the regular Lua headers will also work with LuaJIT. The only headers you need are lua.h, luaconf.h, lauxlib.h, and lualib.h. LuaJIT also comes with luajit.h, but it's not required, and doesn't contain anything that isn't accessible via the jit library.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top