Hi - I have a Visual C++ application that supports Lua plugins using a wide variety of Lua DLLs. The previous version of the program was written in Visual Studio 2010 and uses Lua 5.1.4. The Lua DLLs all had to be versions that were built specifically for the 2010 version of the MSVC compiler. This is because they had to be linked to the C runtime libraries that were specific to MSVC 2010.
I have now upgraded to Visual Studio 2017 which means that I need new compatible versions of all my Lua DLLs. My program is still built 32-bit, so I need 32-bit DLLs. Can anyone suggest where I can get these please? I had a look at the LuaBinaries page on SourceForge and elsewhere, but cannot find a suitable source for the DLLs.
If possible, I would like DLLs that will not need to be replaced if I upgrade my compiler in the future. Any advice on this issue would be appreciated too.
I presume that I will need to upgrade to Lua 5.3.5?
The core Lua DLLs that I need are:
CD (16 dlls)
IM (16 dlls)
IUP (29 dlls)
LUA5.1.dll (or its equivalent for Lua 5.3.5)
LUACOM.DLL
LUAGL.DLL
LFS.DLL
In addition I also need
LUASQL(4 dlls - Kepler project)
MD5 (2 dlls - Kepler project)
SOCKET (2 dlls - LuaRocks)
ZIP.DLL (LuaRocks)
All help very much appreciated.
Simon
Heads up that IUP might be a problem because it's built with mingw (GCC) not msvc. Antonio Scuri might be able to provide more insight, but there are no VS build instructions for IUP. He does provide binaries of IUP and Lua that are pre-configured to work together (available on source forge). There are also Lua mingw binaries provided by JoeDF (
https://joedf.ahkscript.org/LuaBuilds/) and he has a link to the runtime dll. That may get you over the "needs to be MSVC" hump? The runtime link is in the text below the download links on his page.
For MSVC solutions:
LuaWinMake and LuaWinMulti are excellent choices: very simple and flexible.
I've also got a Visual Studio 2017 project file with Wix Installer modules here (You'll want to use the project in the Visual Studio folder, not the Release2 folder.):
Note that the Visual Studio project is quite brittle - you can't just move the source code around without having to remove and re-add the source files (or modify the project files manually) and building for multiple versions requires multiple projects. The VC projects are good if you want to use the MS debugger.
A third alternative is to scavenge from the KeraLua project: it has a CMake based lua build. KeraLua is part of the NLua project that brings Lua to Microsoft.Net. I've been using it to create a Lua enabled serial console:
https://github.com/RussellHaley/NLuaSerialConsole
I'll also point out that if you're integrating with C++, Sol2 is an excellent C++ interface for Lua. I've used it in some small projects with Qt and VS 2017 (both using the MSVC compiler).
In terms of integrating Lua and C++ or .Net: I've been finding it easier to wrap MS libraries and expose them to Lua, rather than trying to import a bunch of Lua modules. The wrapper methodology becomes quite trivial if you use Sol2 or NLua. Most of my integration projects are still just small proof of concept so take that advice with a grain of salt.
If you're intent on using LuaRocks, the new "project configuration" has been quite handy as well: the modules are downloaded to a project specific local folder, but that means you need to copy that folder to your bin directory and it's not portable if you build for more than one architecture.
Hope that helps?
Russ