donderdag 29 september 2016

Compiling lua sqlite lsqlite on mingw64

Below is my compile.bat. The trick is to compile to DLL's and dynamicly link them.
cd lua-5.3.3
mingw32-make mingw
copy src\lua53.dll ..\lua53.dll
copy src\lua.exe ..\lua.exe
cd ..
cd sqlite-amalgamation-3140200
gcc sqlite3.c -shared -m64 -lpthread -o sqlite3.dll
gcc shell.c sqlite3.dll -lpthread -o sqlite3.exe
copy sqlite3.dll ..\sqlite3.dll
cd ..
cd lsqlite3_fsl09w
gcc -c lsqlite3.c -shared -m64 -lpthread -I c:\other\lua_sqlite\lua-5.3.3\src -I c:\other\lua_sqlite\sqlite-amalgamation-3140200
gcc lsqlite3.o c:\other\lua_sqlite\lua53.dll c:\other\lua_sqlite\sqlite3.dll -shared -m64 -lpthread -o lsqlite3.dll
copy lsqlite3.dll ..\lsqlite3.dll
copy examples\simple.lua ..\simple.lua
cd ..
After running this batch, you can type:
lua.exe simple.lua

and the output is:
1       Hello World
2       Hello Lua
3       Hello Sqlite3

Geen opmerkingen:

Een reactie posten