So I've been trying to install some lua packages to compile a lua program on Windows. I use luarocks from a Torch build which I got here: github.com/hiili/WindowsTorch. After executing "luarocks install cutorch" in console window it successfuly downloaded required objects, but failed to generate the project with the following error:
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/grayf/AppData/Local/Temp/luarocks_cutorch-scm-1-9050/cutorch/build/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/nologo" "cmTC_166b8\fast"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\nmake.exe" -f CMakeFiles\cmTC_166b8.dir\build.make /nologo -L CMakeFiles\cmTC_166b8.dir\build
Building C object CMakeFiles/cmTC_166b8.dir/testCCompiler.c.obj
C:\PROGRA~2\MICROS~4\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\cl.exe @C:\Users\grayf\AppData\Local\Temp\nm8BE5.tmp
testCCompiler.c
Linking C executable cmTC_166b8.exe
"C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_166b8.dir --manifests -- C:\PROGRA~2\MICROS~4\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_166b8.dir\objects1.rsp @C:\Users\grayf\AppData\Local\Temp\nm9165.tmp
LINK Pass 1: command "C:\PROGRA~2\MICROS~4\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_166b8.dir\objects1.rsp /out:cmTC_166b8.exe /implib:cmTC_166b8.lib /pdb:C:\Users\grayf\AppData\Local\Temp\luarocks_cutorch-scm-1-9050\cutorch\build\CMakeFiles\CMakeTmp\cmTC_166b8.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_166b8.dir/intermediate.manifest CMakeFiles\cmTC_166b8.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\nmake.exe"' : return code '0x2'
Stop.
CMake will not be able to correctly generate this project.
I searched for kernel32.lib and it's clearly in C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x64. So, as it was suggested in similar discussions on Stackoverflow, I added a link to that folder to PATH along with the x86 folder. Also added SDK folders C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64 and x86 to PATH and installed VC++ 2017 version 15.9 v14.16 latest v141 tools. Tried executing the same command from Visual Studio command prompt, but this and the above didn't solve the issue.
Is there anything I'm missing?
User contributions licensed under CC BY-SA 3.0