Conan: Visual Studio 2019 with v142 CMake Error: Could not create named generator Visual Studio 16 2019

Created on 7 Apr 2019  路  10Comments  路  Source: conan-io/conan

Hey, I am having troubles getting Conan to work with the latest visual studio 2019.
Currently running windows 10 1803 as well as vs 2019 pro ( not the rc) with v142 toolset. I already tried to use the v141 toolset from vs 2017 and use the cmake generator instead of the visual studio one without any luck.
Is there something I am missing ? Beacase I thought support was already added as of #4146 and #4708 / #4707 ? Which would be included in my running version which is Conan version 1.14.1

This is the output I get when I run conan install .

[requires]
Poco/1.9.0@pocoproject/stable
cryptopp/7.0.0@bincrafters/stable 
protobuf/3.6.1@bincrafters/stable

[options]
Poco:shared=False
cryptopp:shared=False
protobuf:shared=False

[generators]
visual_studio

The install fails with this log :
```cryptopp/7.0.0@bincrafters/stable: Generator cmake created conanbuildinfo.cmake
cryptopp/7.0.0@bincrafters/stable: Calling build()
CMake Error: Could not create named generator Visual Studio 16 2019

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".
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.

cryptopp/7.0.0@bincrafters/stable:
cryptopp/7.0.0@bincrafters/stable: ERROR: Package '3fb49604f9c2f729b85ba3115852006824e72cab' build failed
cryptopp/7.0.0@bincrafters/stable: WARN: Build folder C:\Users\Artur.conan\data\cryptopp\7.0.0\bincrafters\stable\build\3fb49604f9c2f729b85ba3115852006824e72cab
ERROR: cryptopp/7.0.0@bincrafters/stable: Error in build() method, line 54
cmake = self._configure_cmake()
while calling '_configure_cmake', line 50
cmake.configure()
ConanException: Error 1 while executing cd C:\Users\Artur.conan\data\cryptopp\7.0.0\bincrafters\stable\build\3fb49604f9c2f729b85ba3115852006824e72cab && cmake -G "Visual Studio 16 2019" -A "x64" -DCONAN_LINK_RUNTIME="/MD" -DCONAN_EXPORTED="1" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="Visual Studio" -DCONAN_COMPILER_VERSION="16" -DCONAN_CXX_FLAGS="/MP12" -DCONAN_C_FLAGS="/MP12" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="C:\Users\Artur.conan\data\cryptopp\7.0.0\bincrafters\stable\package\3fb49604f9c2f729b85ba3115852006824e72cab" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS="False" -DBUILD_STATIC="True" -DBUILD_SHARED="False" -DBUILD_TESTING="False" -DBUILD_DOCUMENTATION="False" -Wno-dev C:\Users\Artur.conan\data\cryptopp\7.0.0\bincrafters\stable\build\3fb49604f9c2f729b85ba3115852006824e72cab
```

  • [x] I've read the CONTRIBUTING guide.
  • [x] I've specified the Conan version, operating system version and any tool that can be relevant.
  • [x] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.
question

Most helpful comment

I manually downloaded the latest cmake for windows which is version 3.14.1. And then the build run trough without any issues.

All 10 comments

Which version of CMake are you using? I think only the latest support the generator.

The version that comes with my visual studio is the 3.13.19031502-MSVC_2
not sure if this is the latest. But couldn't find any information how to update it.

Edit: It seems that the generator is only included in the 3.14 version. Will download it when I am home and then report back.

I manually downloaded the latest cmake for windows which is version 3.14.1. And then the build run trough without any issues.

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.

hI friends, I also have the same problem... I am new to this and I really need your help...please

Generators

  • Visual Studio 16 2019 = Generates Visual Studio 2019 project files.
    Use -A option to specify architecture.
    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".
    Borland Makefiles = Generates Borland makefiles.
    NMake Makefiles = Generates NMake makefiles.
    NMake Makefiles JOM = Generates JOM makefiles.
    MSYS Makefiles = Generates MSYS makefiles.
    MinGW Makefiles = Generates a make file for use with
    mingw32-make.
    Unix Makefiles = Generates standard UNIX makefiles.
    Green Hills MULTI = Generates Green Hills MULTI files
    (experimental, work-in-progress).
    Ninja = Generates build.ninja files.
    Ninja Multi-Config = 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.

Hi @anisi-tua

Which cmake version are you using? And which Conan version?

cmake -G "Visual Studio 16 2019" -A x64

Hi @anisi-tua

Which cmake version are you using? And which Conan version?

Hi @memsharded, I'm using cmake 3.18.2 ......win 64x64 I'm not using Conan I'm using visual studio 2019

Sorry, @anisi-tua, but this is the Conan repository. This is about Conan issues, please do not post questions not related to Conan in this repo.

I manually downloaded the latest cmake for windows which is version 3.14.1. And then the build run trough without any issues.

No explanation. Can you explain how did you install and run flutter, or cmake?

Was this page helpful?
0 / 5 - 0 ratings