lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 19-09-2016 17:01, Leinen, Rick wrote:
Can mingw use the existing lua53.dll created for command line Lua execution in a program it creates?  In other words, can I call Lua from my C program created with mingw using the lua53.dll or do I have to compile the Lua source files with the program?
Yes, that's the beauty with DLLs :)

lua53.dll is a Win32 DLL, and lua.exe is also a "Windows program", just the console type. If you create a windowing Windows program, that is still just a Win32 application and the DLL works the exact same way from that.

If your Windows Program is dotNET, you can use one of many wrappers to ease the usage.

The only trouble you can get into, is if your DLL is 32bit and the Windows Program is 64bit, then you need a Lua53.dll compiled for 64bit (a 64bit process cannot load a 32bit DLL).

/Erik