Nizar
Nizar

Reputation: 1142

CMake Error: Could not create named generator Visual Studio 15 2017 Win64-T

I want to build this project :https://github.com/xmrig/xmrig according to the instructions here: https://github.com/xmrig/xmrig/wiki/Windows-Build, but when I try to run command below:

C:\Users\dmin\Documents\xmrig-2.3.1\build>cmake .. -G "Visual Studio 15 2017 Win
64"-T v140_xp -DCMAKE_BUILD_TYPE=Release  -DUV_INCLUDE_DIR=C:\Program Files\libu
v\include -DUV_LIBRARY=C:\Program Files\libuv\Release\lib\libuv.lib
CMake Error: Could not create named generator Visual Studio 15 2017 Win64-T

I got these errors:

CMake Error: Could not create named generator Visual Studio 15 2017 Win64-T

Generators
  Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
                                 Optional [arch] can be "Win64" or "ARM".
  Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.
                                 Optional [arch] can be "Win64" or "ARM".
  Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files.
                                 Optional [arch] can be "Win64" or "ARM".
  Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files.
                                 Optional [arch] can be "Win64" or "ARM".
  Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files.
                                 Optional [arch] can be "Win64" or "IA64".
  Visual Studio 9 2008 [arch]  = Generates Visual Studio 2008 project files.
                                 Optional [arch] can be "Win64" or "IA64".
  Visual Studio 8 2005 [arch]  = Deprecated.  Generates Visual Studio 2005
                                 project files.  Optional [arch] can be
                                 "Win64".
  Borland Makefiles            = Generates Borland makefiles.
  NMake Makefiles              = Generates NMake makefiles.
  NMake Makefiles JOM          = Generates JOM makefiles.
  Green Hills MULTI            = Generates Green Hills MULTI files
                                 (experimental, work-in-progress).
  MSYS Makefiles               = Generates MSYS makefiles.
  MinGW Makefiles              = Generates a make file for use with
                                 mingw32-make.
  Unix Makefiles               = Generates standard UNIX makefiles.
  Ninja                        = Generates build.ninja files.
  Watcom WMake                 = Generates Watcom WMake makefiles.
  CodeBlocks - MinGW Makefiles = Generates CodeBlocks project files.
  CodeBlocks - NMake Makefiles = Generates CodeBlocks project files.
  CodeBlocks - NMake Makefiles JOM
                               = Generates CodeBlocks project files.
  CodeBlocks - Ninja           = Generates CodeBlocks project files.
  CodeBlocks - Unix Makefiles  = Generates CodeBlocks project files.
  CodeLite - MinGW Makefiles   = Generates CodeLite project files.
  CodeLite - NMake Makefiles   = Generates CodeLite project files.
  CodeLite - Ninja             = Generates CodeLite project files.
  CodeLite - Unix Makefiles    = Generates CodeLite project files.
  Sublime Text 2 - MinGW Makefiles
                               = Generates Sublime Text 2 project files.
  Sublime Text 2 - NMake Makefiles
                               = Generates Sublime Text 2 project files.
  Sublime Text 2 - Ninja       = Generates Sublime Text 2 project files.
  Sublime Text 2 - Unix Makefiles
                               = Generates Sublime Text 2 project files.
  Kate - MinGW Makefiles       = Generates Kate project files.
  Kate - NMake Makefiles       = Generates Kate project files.
  Kate - Ninja                 = Generates Kate project files.
  Kate - Unix Makefiles        = Generates Kate project files.
  Eclipse CDT4 - NMake Makefiles
                               = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - MinGW Makefiles
                               = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Ninja         = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.

How I can solve it?

PS: it's not duplicated as there's no answer CMake Error: Could not create named generator Visual Studio 14 2015 win64

Thank you

Upvotes: 12

Views: 24898

Answers (4)

JonathanG
JonathanG

Reputation: 51

Solution that worked for me: Use Visual Studio's own CMake.

Similar to the answer posted by Praveen Patel above, my issue was a CMake issue. In my case VS2022 wasn't happy with the CMake that preceeded its own CMake in my path, although the two versions were very similar. I disabled my stand-alone CMake, leaving Visual Studio to use its own, and then everything worked fine.

i.e.

Before:

> which cmake
/c/Program Files (x86)/CMake/bin/cmake
> cmake --version
cmake version 3.20.4

Fix:

Effectively remove "c:\Program Files (x86)\CMake"

After:

> which cmake
/c/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake
> cmake --version
cmake version 3.26.4-msvc4

...and everybody was happy.

Upvotes: 0

Praveen Patel
Praveen Patel

Reputation: 31

The issue is due to the old CMake version, update your CMake and try. You can check the version of your CMake by running CMake --version. you should install CMake to the latest available version. Sometimes if you already have the latest CMake installed, but your CMake --version is showing an old version that means your CMake is being picked up from some other place. Check your environment variable PATH and move your Cmake installation bin path to the top of the PATH list.

Upvotes: 3

Carl Cornelio
Carl Cornelio

Reputation: 1

I HAD THE SAME ISSUE. But my problem was, I had Cygwin installed, and Cygwin had their own built-in version of C-make. What I did was- untie Cygwin from my command prompt (cmd), then rebuilt it. It then worked. Make sure you don't have something tied into your command prompt (cmd), like Cygwin, because they have their own version of 'Cmake'.

One way of checking this out is by typing in 'cygwin' into your command prompt (cmd), or into your search, and try tracing its file origin, and try removing its ties from command prompt, or by just uninstalling the app which utilizes a different version of Cmake.

Upvotes: 0

Jacek Blaszczynski
Jacek Blaszczynski

Reputation: 3269

Looking at error message it says that there is no:

Visual Studio 15 2017 Win64-T

As you may notice cmake parsed your command merging Win64" and -T option. In command line you pasted:

there is no space between Win64" and -T.

Add one and run command again.

Upvotes: 3

Related Questions