davidm / luacom

Microsoft Component Object Model (COM) binding for Lua
http://lua-users.org/wiki/LuaCom
Other
116 stars 51 forks source link

Cannot require LuaCOM v.1.4 with Lua v.5.3.5 #24

Open RostislavDmKudryashov opened 4 years ago

RostislavDmKudryashov commented 4 years ago

I use Windows 8.1 and Visual C++ 2015. Everithing works fine with Lua v.5.1.5. I built LuaCOM for Lua v.5.3.5 in the same way, but using macro NLUA51. Everything comiled and linked successfully. But after require ("luacom") I got the message [string "luacom5.lua"]:9: assertion failed! This message is issued by the file luacom5.loh invoked in the function luacom_open in the file luacom.cpp. I converted luacom5.lua to luacom5.loh using program bin2c.lua. The LuaCOM distribute is downloaded from https://github.com/davidm/luacom

Does anyone know how to build correct luacom.dll 64 bit or where it can be downloaded from?

Compiling src\library*.cpp: cl /c /W4 /EHsc @all-5.3.5-64.rsp File all-5.3.5-64.rsp:

/D_CRT_SECURE_NO_WARNINGS /DNLUA51 /ID:\BAT\Lua\5.3.5-64\include /ID:\BAT\Lua\LuaCOM\5.3.5-64\include /ID:\BAT\Lua\LuaCOM\5.3.5-64\src\library LuaAux.cpp luabeans.cpp luacom.cpp LuaCompat.cpp tCOMUtil.cpp tLuaCOM.cpp tLuaCOMClassFactory.cpp tLuaCOMConnPoints.cpp tLuaCOMEnumerator.cpp tLuaCOMException.cpp tLuaCOMTypeHandler.cpp tLuaControl.cpp tLuaDispatch.cpp tLuaObject.cpp tLuaObjList.cpp tLuaTLB.cpp tLuaVector.cpp tStringBuffer.cpp tUtil.cpp

Compiling and linking src\dll\luacom_dll.cpp: cl /W4 /EHsc luacom_dll.cpp @lnk.rsp File lnk.rsp:

/D_CRT_SECURE_NO_WARNINGS /DNLUA51 /ID:\BAT\Lua\5.3.5-64\include /ID:\BAT\Lua\LuaCOM\5.3.5-64\include /ID:\BAT\Lua\LuaCOM\5.3.5-64\src\library /LD /Fe:luacom.dll luacom_dll.def LuaAux.obj luabeans.obj luacom.obj LuaCompat.obj tCOMUtil.obj tLuaCOM.obj tLuaCOMClassFactory.obj tLuaCOMConnPoints.obj tLuaCOMEnumerator.obj tLuaCOMException.obj tLuaCOMTypeHandler.obj tLuaControl.obj tLuaDispatch.obj tLuaObject.obj tLuaObjList.obj tLuaTLB.obj tLuaVector.obj tStringBuffer.obj tUtil.obj user32.lib advapi32.lib oleaut32.lib ole32.lib htmlhelp.lib shlwapi.lib gdi32.lib lua53.lib /link /LIBPATH:D:\BAT\Lua\LuaCOM\5.3.5-64\src\library /link /LIBPATH:D:\BAT\Lua\5.3.5-64 /link /LIBPATH:D:\BAT\Lua\5.3.5-64\clibs /link /machine:x64

File luacom_dll.def:

EXPORTS luaopen_luacom luacom_openlib DllGetClassObject PRIVATE

moteus commented 4 years ago

You also have to rebuild luacom5.loh. This file also depends on Lua version

RostislavDmKudryashov commented 4 years ago

If you looked at the file luacom5.lua - the source code for the luacom5.loh - you would see that the line #9 is the first executed and contains the statement: assert(luacom) It is the line that generates the error. But this line does not depend on the Lua version in any way!

Not to mention that I actually rebuilt this file. You just didn't read the 7th line of my original message. The conversion (rebuilding) was done using the command lua53.exe bin2c.lua luacom5.lua > luacom5.loh

moteus commented 4 years ago

I only can suggest trying my fork which works with Lua 5.3 I remembering that I export luacom to the global namespace.

1linux commented 4 years ago

Really? I think luacom5.loh is compiled to bytecode, therefore its not compatible between versions and has to be rebuilt.

Helmut

Am 18.06.2020 um 06:23 schrieb RostislavDmKudryashov notifications@github.com:

 If you looked at the file luacom5.lua - the source code for the luacom5.loh - you would see that the line #9 is the first executed and contains the statement: assert(luacom) It is the line that generates the error. But this line does not depend on the Lua version in any way!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

RostislavDmKudryashov commented 4 years ago

A thousand thanks to moteus! Your distribute https://github.com/moteus/luacom is OK. To compile luacom.cpp from the command line I had to replace LUACOM_DLL with "luacom.dll".

jldowson commented 10 months ago

Can anyone provide a 64-bit luacom.dll for download? Or do I have to build it myself from https://github.com/moteus/luacom? If so, can you/anyone confirm that is for a 64-bit version of the dll and that it is fully working. I don't really want to have to install VS 2010 (already gave 2015, 2017, 2019 and 2022 installed...!) to build this but I will if there is no other way. Seems to be a reasonably common request for the 64-bit version, and I am surprised that someone hasn't made the binary directly available....

Thanks!