# luajit_vs_dll **Repository Path**: bytes33/luajit_vs_dll ## Basic Information - **Project Name**: luajit_vs_dll - **Description**: luajit 使用vs2013 编译dll - **Primary Language**: C - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2015-10-09 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #luajit_vs_dll 使用 #define _CRT_SECURE_NO_WARNINGS 屏蔽CAPI警告错误 在VS2013 中编译luajit: 1. 编译minilua (src/host/minilua.c) 2. 使用minnilua 生成buildvm_arch.h 在工程里加入后期生成事件 $(SolutionDir)Debug\MiniLua\MiniLua.exe $(SolutionDir)LuaJIT-2.0.3/dynasm/dynasm.lua -LN -D WIN -D JIT -D FFI -o $(SolutionDir)LuaJIT-2.0.3/src/host/buildvm_arch.h $(SolutionDir)LuaJIT-2.0.3/src/archdasc/vm_x86.dasc 3. 在buildvm 工程里加入后期生成事件 @setlocal cd /d $(SolutionDir)LuaJIT-2.0.3\src @set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c $(SolutionDir)Debug\Buildvm\buildvm.exe -m peobj -o $(SolutionDir)Debug\Buildvm\lj_vm.obj $(SolutionDir)Debug\Buildvm\buildvm.exe -m bcdef -o lj_bcdef.h %ALL_LIB% $(SolutionDir)Debug\Buildvm\buildvm.exe -m ffdef -o lj_ffdef.h %ALL_LIB% $(SolutionDir)Debug\Buildvm\buildvm.exe -m libdef -o lj_libdef.h %ALL_LIB% $(SolutionDir)Debug\Buildvm\buildvm.exe -m recdef -o lj_recdef.h %ALL_LIB% $(SolutionDir)Debug\Buildvm\buildvm.exe -m vmdef -o jit\vmdef.lua %ALL_LIB% $(SolutionDir)Debug\Buildvm\buildvm.exe -m folddef -o lj_folddef.h lj_opt_fold.c @endlocal 4. 把src中的*.c *.h 加入一个dll工程 工程中加入LUA_BUILD_AS_DLL宏,生成dll