Make sure that there is only one incarnation of both Lua and the runtime
library around in your app and all dll's it uses. The simplest way to do
this is to place all Lua runtimes (lua core and aux libs) in a lua.dll and
link your application and all your dll's (including lua.dll) against the
dynamic runtime library (msvcrtXXX.dll)
These kinds of problems are typically caused by mixing dynamically and
statically linked runtime libraries or using statically linked runtimes is
more than one instance (exe, dll).