I guess Lua support was not really built for Windows (Visual Studio) with the sources within the
civetweb-1.4.tar.gz from
http://sourceforge.net/projects/civetweb/files/1.4/ ?
In order to build it, I had to add the defines USE_LUA;USE_WEBSOCKET;USE_LUA_SQLITE3 and set the include path to
$(ProjectDir)..\..\include;$(ProjectDir)..\..\src\third_party\;$(ProjectDir)..\..\src\third_party\lua-5.2.2\src;%(AdditionalIncludeDirectories)
A current lsqlite3.c version (2013) compatible with Lua 5.2 is attached. It should completely replace the one currently in the source tree from 2007.
There has been an interface change in civetweb.c for "conn2", the corresponding update in mod_lua.inl was still missing. The must_close has been added (one could improve this in a next step).
The two files attached do work in my test.