LuxCoreRender / WindowsCompile

LuxCoreRender Windows Compilation Environment
11 stars 10 forks source link

No CMAKE_C_COMPILER could be found. #11

Closed Theverat closed 5 years ago

Theverat commented 5 years ago

I'm trying to compile LuxCore on a fresh install of Windows 10. I followed all steps in the readme, but I am getting this error:

D:\Projects\LuxCore\WindowsCompile>.\cmake-build-x64.bat
Finding if CMake is installed...
CMake found at "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe  "
We are using CMake version: 3
LIB_DIR: D:\Projects\LuxCore\WindowsCompileDeps\x64\Release\lib
-- CMake version 3.11.18040201-MSVC_2 detected
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:42 (enable_language):
  No CMAKE_C_COMPILER could be found.

-- Configuring incomplete, errors occurred!
See also "D:/Projects/LuxCore/WindowsCompile/Build_CMake/LuxCore/CMakeFiles/CMakeOutput.log".
See also "D:/Projects/LuxCore/WindowsCompile/Build_CMake/LuxCore/CMakeFiles/CMakeError.log".
--- FATAL ERROR RUNNING CMAKE ---
Dade916 commented 5 years ago

Are you sure to use the right CMD ? The one provided by VisuslStudio with all env. var. declared.

Theverat commented 5 years ago

Yes, the "x64 Native Tools Command Prompt for VS 2017"

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

I searched a bit and found this: https://stackoverflow.com/questions/32801638/cmake-error-at-cmakelists-txt30-project-no-cmake-c-compiler-could-be-found It might be that I actually have to install the full VS IDE, otherwise some C++ packages are not installed (I have selected all C++ stuff I could find in the build tools installer).

Theverat commented 5 years ago

I have now installed the full VS 2017 IDE, but still the same error. I can create new projects in the IDE and compile them.

By the way, I had to install the build tools even after installing the IDE (they are not included). Maybe this should be added to the readme (currently it says to install the IDE only).

acasta69 commented 5 years ago

Not sure if it can cause your problem, but... have you installed also an SDK, e.g. Windows 10 SDK? I don't remember if at least one is selected by default.

About the build tools: I am pretty sure that I used only one installer (the one with the IDE) for my Windows 10 install, but it was almost 1 year ago, something could have changed in latest versions.

Theverat commented 5 years ago

I simply cannot get it to work.

Here's what I have installed:

stitched

(7 screenshots stitched together)

I have found a lot of websites where people had similar issues like me, but they all fixed it by "installing some additional packages" or by installing the 8.1 SDK.

acasta69 commented 5 years ago

My installed components are quite similar to yours. We have different versions, and you have a couple more things here and there, but they shouldn't be related. I'll try to set up a Win10 VM to install these things from scratch and see if I can replicate the issue with a fresh install, but I need to find the time for that.

P.S. I was thinking... you have the very latest VS version (15.9), but cmake v3.11.x (I have VS tools 15.7.1 and cmake 3.11.2). Maybe a more recent cmake version has better MSVC support? I don't think that's the problem, but maybe it's worth a try...

Theverat commented 5 years ago

I'll try to set up a Win10 VM to install these things from scratch and see if I can replicate the issue with a fresh install, but I need to find the time for that.

That would be very appreciated! I was hesitant to ask for this because I know it's a lot of work.

acasta69 commented 5 years ago

At a first attempt everything is working fine here. I have installed a slightly different version than yours (VS2017 is updated very quickly). For me the included cmake version is 3.12.18081601_MSVC2. I have also tried to uninstall MSVC cmake support and download separately cmake 3.11.4. It also works:

C:\Dati\LuxCoreRender\WindowsCompile>cmake-build-x64.bat
Finding if CMake is installed...
CMake found at "C:\Tools\cmake-3.11.4-win64-x64\bin\cmake.exe  "
We are using CMake version: 3
LIB_DIR: C:\Dati\LuxCoreRender\WindowsCompileDeps\x64\Release\lib
-- CMake version 3.11.4 detected
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.10586.
-- The C compiler identification is MSVC 19.16.27024.1
-- 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
-- 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 -- works

There are some more minor differences in installed components: I will try to make them exactly the same. Anyway, at the moment I cannot reproduce that problem.

Theverat commented 5 years ago

Thank you for testing. Could be something specific to my system. Maybe some program messed up my PATH in a subtle way that I missed, or so.

acasta69 commented 5 years ago

I tested again after installing exactly the same packages as you have, and it's still working.

Could be something specific to my system. Maybe some program messed up my PATH in a subtle way that I missed, or so.

Maybe... If you want to check, my path within the "x64 Native" command prompt looks like this:

PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja

Only Visual Studio is installed. I don't know what else to think of, sorry...

Theverat commented 5 years ago

All of your paths are also included in mine. The only odd thing I could spot is that my PATH contains one empty entry (double semicolon), but removing it did not change anything. Thanks again for checking.

Theverat commented 5 years ago

I have now installed everything in a (Win7) VM and ... it compiles.