Well that was relatively painless. :)
I added #define LUA_LIB to the top of each lua.c, changed main(...) to LUA_API mainL(...) in both lua.c versions. I compiled them into their respective DLLs and hacked the 51 version to ignore the extra "-51" argument (it was just easier...). In my application I load one file or the other and just pass the args as is. I'm quite chuffed with the results[1]:
C:\Users\russh\projects\desktopLua> .\bin\dtlua.exe -e "print('this is a test')"
Filename is?: C:\users\russh\projects\desktoplua\bin\lua54.dllThe LoadLibrary(L"mydllpro") dll handle is valid...
The function address is valid: 00007FF96A5B5790
this is a test
FreeLibrary() is OK.
C:\Users\russh\projects\desktopLua> .\bin\dtlua.exe -51 -e "print('this is a test')"
Hello from Tokyo: -51Filename is?: C:\users\russh\projects\desktoplua\bin\lua51.dllThe LoadLibrary(L"mydllpro") dll handle is valid...
The function address is valid: 00007FF96A5BB280
this is a test
FreeLibrary() is OK.
Thanks to Josh Jensen again. I used his JamPlus build system and just stole from the example that builds lua. I wrote the whole thing in Geany and used Powershell command line to build. Nice!
Thanks so much for your help V. It's really great being able to ping these ideas off you.
Perhaps, Dirk, you can have my nip of bourbon and celebrate for the both of us? :)