lua-users home
lua-l archive

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

I’m still trying to get hold of a build of luacom.dll that is linked to VCRUNTIME140.DLL and Lua 5.3.  I’m running Visual Studio 2017.


Thanks for the suggestions Thijs (on overcoming problems with luarocks – see previous)  but I couldn’t get it to work.  This is what I did:


I downloaded “” from, unzipped it, and put the unzipped folder (called luacom-master) in my d:\my\lua folder that I’d already installed lua into using LuaRocks.


I opened the Visual Studio 2017 command line prompt window and set up various environment variables as instructed.  I also ran “setlua 53” using setlua.bat in the bin folder.


I renamed as in the luacom-master subfolder.  Within that same folder I then ran “luarocks make”.  That failed and produced the following output:


Warning: variable CFLAGS was not passed in build_variables


Microsoft (R) Program Maintenance Utility Version 14.16.27030.1

Copyright (C) Microsoft Corporation.  All rights reserved.


        if not exist .\lib mkdir .\lib

        if not exist .\obj\lua53 mkdir .\obj\lua53

        D:/My/Lua/lib\luac5.1.exe -o ".\src\library\luacom5.lo" ".\src\library\luacom5.lua"

        D:/My/Lua/lib\bin2c5.1.exe ".\src\library\luacom5.lo" > ".\src\library\luacom5.loh"

        cl /c /DLUACOM_DLL=\"luacom.dll\" /EHsc -ID:/My/Lua/include/lua/5.3 -I.\include -I.\src\library -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -DLUA_COMPAT_MODULE -DNLUA51 -nologo -MD -Zi -O2 -DNDEBUG  /Fo.\obj\lua53/luacom.obj .\src\library\luacom.cpp


.\src\library\luacom.cpp(2295): fatal error C1083: Cannot open include file: 'luacom5.loh': No such file or directory

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.EXE"' : return code '0x2'



Error: Build error: Failed building.


Within the luacom folder I found a luacom.sln file (a MS Visual Studio ‘Solution’ file).  I tried opening that in Visual Studio 2017.  It seemed to be able to convert it to VS 2017, albeit with numerous warning messages.  But when I tried to build it within MS Visual C++ 2017 I got this error message:


1>------ Build started: Project: luacom.dll, Configuration: Debug Win32 ------

1>D:\My\Lua\luacom-master\mak.vs2005\luacom.dll.vcxproj(40,5): warning MSB4011: "D:\My\Lua\luacom-master\mak.vs2005\luacom.props" cannot be imported again. It was already imported at "D:\My\Lua\luacom-master\mak.vs2005\luacom.dll.vcxproj (32,5)". This is most likely a build authoring error. This subsequent import will be ignored.

1>Compiling Lua to C: [inputs] -> [OutputFile]

1>D:\My\Lua\luacom-master\mak.vs2005\luacom.targets(46,5): error MSB3721: The command " -o Debug\tmp.lo  ..\src\library\luacom5.lua &&  Debug\tmp.lo > D:\My\Lua\luacom-master\mak.vs2005\luacom5.loh" exited with code 1.

1>Done building project "luacom.dll.vcxproj" -- FAILED.

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Any more suggestions anyone?  Or has anyone already got a build of luacom.dll linked to VCRUNTIME140.DLL and Lua 5.3 somewhere?   Thanks in advance.





From: [] On Behalf Of Thijs Schreijer
Sent: 04 April 2019 1:35 PM
To: Lua mailing list
Subject: Re: LuaRocks build problem with luacom



On 3 Apr 2019, at 12:08, Simon Orde <> wrote:


Hi - Is this the right place to ask a LuaRocks question?  I’ve been trying to build various lua dlls using LuaRocks – for Lua5.3 and the VC runtime for Visual Studio 2017 (VCRUNTIME140.DLL).   I downloaded and tried to follow the instructions.  I had one folder for the luawinmulti-master stuff and another target folder to build into.   I opened the Visual Studio 2017 Tools Command Prompt (where hopefully all the paths etc are set up as needed) and in the luawinmulti-master folder ran 


MAKE --53 install “D:\My\Lua”


to build into the target folder.  I set up environment variables as instructed (I think – not sure what the ‘rocktree’ references are about).  Still in the same command shell I ran


Not sure what environment variables you’re referring to. Only thing I can think of is the output of the LuaRocks installer. But you can ignore this, and instead use the supplied batch file `setlua.bat`, see

(LuaWinMulti install LuaRocks and does the hard work for you, so the intermediate output by LuaRocks can be ignored)



·         luarocks53 install luafilesystem                  (to build lfs.dll)

·         luarocks53 install luacom                              (to build

·         luarocks53 install md5                                    (to build des56.dll and md5\core.dll)


lfs.dll, des56.dll, and md5\core.dll all appear OK as far as I can see.  If I look at them in Dependencies (the app), they link to Lua53.dll and VCRUNTIME140.DLL.  But something is not right when I build luacom.dll.  For some reason, it shows in Dependencies linked to Lua5.1.dll and MSVCR80.dll.


I have tried all the variations I can think of but somehow luacom.dll always ends up linked to 5.1 and MSVCR80.dll.  Has anyone got any suggestions as to what I may be doing wrong?  I should add that I have never used LuaRocks before.


the rockspec relies on Make instead of the LuaRocks builtin build tools;

Essentially this means LuaRocks has less control over how it is build, and in this case it seems to work against you.


This is a really old library, the makefile has quite some references to 5.1 ( )


The good news, is that in the repo above, there also is a `` so maybe you could use that? Just clone the repo, rename that file to `` and do `luarocks make` from the repo

(Make sure to do it from the VS command shell, and first call `setlua.bat 53`)


Have no Windows system myself…