Closed janwilmans closed 5 years ago
Hi, about the error for the missing binary, we are not generating binaries for VS 2019 yet in conan-center, so it is normal. Hopefully we can do it soon. I think the message actually tells you what to do, right? e.g:
zlib/1.2.11@conan/stable: WARN: Can't find a 'zlib/1.2.11@conan/stable' package for the specified settings, options and dependencies:
- Settings: arch=ppc32, build_type=Release, compiler=gcc, compiler.version=7, os=Linux
- Options: fPIC=True, minizip=False, shared=False
- Dependencies:
- Package ID: aabb35281493fa466f0981b5e28055c24debcb33
ERROR: Missing prebuilt package for 'zlib/1.2.11@conan/stable'
Try to build it from sources with "--build zlib"
Or read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-missing-prebuilt-package"
About the CMake
error, For the visual 2019 support I think you need CMake >= 3.14
About the CMake error, For the visual 2019 support I think you need CMake >= 3.14
Nope. I've got CMake 3.14.3 and I'm still getting this error. The problem is that conan assumes that msvc is always used with Visual studio generator and does not correctly handle the case for MSVC + Ninja builds (which are default for VS when you use "Open Folder" mode).
The error
Generator
Ninja
does not support platform specification, but platform
x64
was specified.
is caused by this command line within conan's build:
cmake -G "Ninja" -A "x64" -DCONAN_LINK_RUNTIME="/MD" -DCMAKE_BUILD_TYPE="Release" -DCONAN_EXPORTED="1" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="Visual Studio" -DCONAN_COMPILER_VERSION="16" -DCONAN_CXX_FLAGS="/MP8" -DCONAN_C_FLAGS="/MP8" -DCMAKE_INSTALL_PREFIX="C:\Users\jenkins\.conan\data\GTest\1.8.0.2\microblink\stable\package\bd908d6af41ee9974ebf9d74a4df66b5b25c0bca" -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" -Wno-dev ...
.
The problematic part is flag -A "x64"
, which is appended in this line because self.generator_platform
is True
because this function only checks whether compiler is Visual Studio, but not also if generator is "visual studio". Therefore, it appends this cmake flag even in ninja/makefile builds.
This needs to be fixed.
I've made a patch for it (#5025) and tested in my case that it works.
@memsharded, @lasote, please check it and see if it will make into v1.14.4.
Fixed by https://github.com/conan-io/conan/pull/5028, will be in Conan 1.14.4
Note: I have visual studio 2019 installed, but I'm targeting vs2017.
I open up a visual studio 2017 command prompt and the example https://docs.conan.io/en/latest/getting_started.html#an-md5-encrypter-using-the-poco-libraries fails to build.
First of all:
ERROR: Missing prebuilt package for 'zlib/1.2.11@conan/stable'
the binary package is not available (makes sense, but I did not know what to do about it, so maybe offer a suggestion of using -b with that error message.then I tried
conan install .. -b
which failed with: CMake Error: Could not create named generator Visual Studio 16 2019That is probably CMake lagging behind (or my version of it is not up to date, so I switched to Ninja using
set CONAN_CMAKE_GENERATOR=Ninja
and re-run
conan install .. -b
Then I run into:
And I had to change.conan\profiles\default to work around that.
compiler.version=16
tocompiler.version=15
in C:\Users\C:\Users\.conan\profiles\default
C:\Users\.conan\settings.yml