How do I make visual studio 2017 compiler, specifically cl.exe work with luarocks?

1k views Asked by At

I tried to just find a lua rocks library made for lua 5.3 first of all so I come across mathx, I have no idea what this library really does I just wanted to test luarocks installation is working correctly. Everything seems to be working fine but what I believe now in windows by default it is currently looking for cl.exe, in visual studio 2017 I have this file located at:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\cl.exe

However setting this directory in the path does not allow me to initiate the command in eithe command prompt of 'cl'

When installing from lua command prompt:

C:\Users\MYNAMEHERE>luarocks install lmathx Installing luarocks.org/lmathx-20150624-1.src.rock cl /nologo /MD /O2 -c -Folmathx.obj -IC:/lua/include lmathx.c 'cl' is not recognised as an internal or external command, operable program or batch file.

Error: Build error: Failed compiling object lmathx.obj

When installing from visual studio 2017 command prompt:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>luarocks install lmathx Installing luarocks.org/lmathx-20150624-1.src.rock cl /nologo /MD /O2 -c -Folmathx.obj -IC:/lua/include lmathx.c lmathx.c link -dll -def:mathx.def -out:mathx.dll C:/lua/lua53.dll lmathx.obj Microsoft (R) Incremental Linker Version 14.10.25019.0 Copyright (C) Microsoft Corporation. All rights reserved.

C:\lua\lua53.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x430 Error: Build error: Failed compiling module mathx.dll I think my macbook is doing similar but I will have to look at that another day so I am putting that aside for now. The module I have tried to install above is: luarocks.org/modules/ignacio/lmathx

C:\Users\MYNAMEHERE>luarocks install luai Installing luarocks.org/luai-1.0-2.src.rock luai 1.0-2 is now installed in C:\lua\systree (license: MIT/X11) I have managed to get one module installed: luarocks.org/modules/cschen1205/luai which gave the following output in normal windows command prompt after typing: luarocks install luai

C:\Users\MYNAMEHERE>luarocks install luai Installing zluarocks.org/luai-1.0-2.src.rock luai 1.0-2 is now installed in C:\lua\systree (license: MIT/X11) However I was struggling to get any lua code to test this even on there github for it.

I am left stumped overall either I can't get windows to pick up the visual studio 2017 compiler to build luarocks files (Please note I do have C:\MinGW installed as a portable version as well with c and c++ compiler in there of gcc but this is already set in path, I can use this instead if vs studio 2017 is to new to work but how to default lua rocks to mingw gcc rather than cl.exe to build libraries????) or something installs then I am struggling to find out how its installed (not from source, presumed though???)or sample code to check such a luarock has installed.

0

There are 0 answers