fireice-uk / xmr-stak

Free Monero RandomX Miner and unified CryptoNight miner
GNU General Public License v3.0
4.05k stars 1.79k forks source link

Windows build instructions don't mention SDKs #234

Closed blacklion closed 6 years ago

blacklion commented 6 years ago

When repeat windows build instructions step-by-step I get this error:

CMake Error at CMakeLists.txt:1 (project):
  Failed to run MSBuild command:

    C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/Bin/MSBuild.exe

  to get the value of VCTargetsPath:

    Microsoft (R) Build Engine version 15.4.8.50001 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.

    Build started 24.11.2017 22:57:42.
    Project "C:\home\lev\xmr-stak\xmr-stak\build\CMakeFiles\3.10.0\VCTargetsPath.vcxproj" on node 1 (default targets).
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\x64\PlatformToolsets\v141\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\home\lev\xmr-stak\xmr-stak\build\CMakeFiles\3.10.0\VCTargetsPath.vcxproj]
    Done Building Project "C:\home\lev\xmr-stak\xmr-stak\build\CMakeFiles\3.10.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.

    Build FAILED.

Looks like Visual Studio 2017 Community installation doesn't include Windows SDK and SDK should be installed separately.

blacklion commented 6 years ago

After installing SDK 8.1 error changes:

C:\home\lev\xmr-stak\xmr-stak\build>cmake -G "Visual Studio 15 2017 Win64" -T v141,host=x64 -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF -DWIN_UAC=OFF ..
-- Selecting Windows SDK version  to target Windows 10.0.16299.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:1 (project):
  No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:1 (project):
  No CMAKE_CXX_COMPILER could be found.

-- Configuring incomplete, errors occurred!
See also "C:/home/lev/xmr-stak/xmr-stak/build/CMakeFiles/CMakeOutput.log".
See also "C:/home/lev/xmr-stak/xmr-stak/build/CMakeFiles/CMakeError.log".

I've run VsMSBuildCmd.bat

C:\home\lev\xmr-stak>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat"
**********************************************************************
** Visual Studio 2017 MSBuild Command Prompt
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************

I know very little about development for Windows :-)

MilosMosovsky commented 6 years ago

Did you install cmake for windows? It` inside docs https://cmake.org/download/ this is essential as it's compiler

blacklion commented 6 years ago

@MilosMosovsky Yes, of course. "CMake Error" is produced by cmake! And cmake is not compiler it is project generator (meta build system).

saylor68 commented 6 years ago

you chose at install time to set paths for all users? reboot and try? I had to delete .\users\username\source dir before too.

blacklion commented 6 years ago

CMake was added to PATH in this cmd window (it runs Ok), and msbuild environment was loaded by bat-file provided by MSVC…

SlaytanicPB commented 6 years ago

Which version of windows are you building for? You do have to install 10 or 8.1 if you are compiling for one of those platforms. If it's windows 7, you have to use the XP SDK in Visual Studio. Also, when using VsMSBuildCmd.bat there are certain defaults it will select for you.

Try VsMSBuild.bat -help You'll see all the options to help cmake run properly.