Conan: Fail build the getting started example

Created on 18 Mar 2019  路  10Comments  路  Source: conan-io/conan

To help us debug your issue please explain:

  • [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.

I tried to follow the tutorial here without success: https://docs.conan.io/en/latest/getting_started.html

  1. I cloned the code here in order to avoid copy/paste mistake: https://github.com/conan-community/poco-md5-example
  2. I create the build folder: mkdir build && cd build
  3. I ran conan install .. which result in a first error:
Poco/1.9.0@pocoproject/stable: WARN: Can't find a 'Poco/1.9.0@pocoproject/stable' package for the specified settings, options and dependencies:
- Settings: arch=x86_64, build_type=Release, compiler=apple-clang, compiler.libcxx=libstdc++, compiler.version=10.0, os=Macos
- Options: cxx_14=False, enable_apacheconnector=False, enable_cppparser=False, enable_crypto=True, enable_data=True, enable_data_mysql=False, enable_data_odbc=False, enable_data_sqlite=True, enable_json=True, enable_mongodb=True, enable_net=True, enable_netssl=True, enable_netssl_win=True, enable_pagecompiler=False, enable_pagecompiler_file2page=False, enable_pdf=False, enable_pocodoc=False, enable_sevenzip=False, enable_tests=False, enable_util=True, enable_xml=True, enable_zip=True, fPIC=True, force_openssl=True, poco_unbundled=False, shared=False, OpenSSL:386=False, OpenSSL:no_asm=False, OpenSSL:no_bf=False, OpenSSL:no_cast=False, OpenSSL:no_des=False, OpenSSL:no_dh=False, OpenSSL:no_dsa=False, OpenSSL:no_hmac=False, OpenSSL:no_md2=False, OpenSSL:no_md5=False, OpenSSL:no_mdc2=False, OpenSSL:no_rc2=False, OpenSSL:no_rc4=False, OpenSSL:no_rc5=False, OpenSSL:no_rsa=False, OpenSSL:no_sha=False, OpenSSL:no_sse2=False, OpenSSL:no_threads=False, OpenSSL:no_zlib=False, OpenSSL:shared=False, zlib:fPIC=True, zlib:minizip=False, zlib:shared=False
- Dependencies: OpenSSL/1.0.2o@conan/stable
- Package ID: 69dd885229d93087ed28ec19fe62042c86f78cfc

ERROR: Missing prebuilt package for 'Poco/1.9.0@pocoproject/stable'
Try to build it from sources with "--build Poco"
Or read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-missing-prebuilt-package"
  1. I followed the advice by entering the command conan install .. --build Poco but it failed again:
-- Building: Data
-- Building: Zip
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CMAKE_INSTALL_BINDIR
    CMAKE_INSTALL_DATAROOTDIR
    CMAKE_INSTALL_INCLUDEDIR
    CMAKE_INSTALL_LIBDIR
    CMAKE_INSTALL_LIBEXECDIR
    CMAKE_INSTALL_OLDINCLUDEDIR
    CMAKE_INSTALL_SBINDIR


-- Build files have been written to: /Users/martin/.conan/data/Poco/1.9.0/pocoproject/stable/build/69dd885229d93087ed28ec19fe62042c86f78cfc/build
Scanning dependencies of target Foundation
[  0%] Building CXX object Foundation/CMakeFiles/Foundation.dir/src/ASCIIEncoding.cpp.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from /Users/martin/.conan/data/Poco/1.9.0/pocoproject/stable/build/69dd885229d93087ed28ec19fe62042c86f78cfc/poco/Foundation/src/ASCIIEncoding.cpp:15:
In file included from /Users/martin/.conan/data/Poco/1.9.0/pocoproject/stable/build/69dd885229d93087ed28ec19fe62042c86f78cfc/poco/Foundation/include/Poco/ASCIIEncoding.h:21:
In file included from /Users/martin/.conan/data/Poco/1.9.0/pocoproject/stable/build/69dd885229d93087ed28ec19fe62042c86f78cfc/poco/Foundation/include/Poco/Foundation.h:111:
/Users/martin/.conan/data/Poco/1.9.0/pocoproject/stable/build/69dd885229d93087ed28ec19fe62042c86f78cfc/poco/Foundation/include/Poco/Alignment.h:35:10: fatal error: 'cstddef' file not found
#include <cstddef>
         ^~~~~~~~~
1 warning and 1 error generated.
make[2]: *** [Foundation/CMakeFiles/Foundation.dir/src/ASCIIEncoding.cpp.o] Error 1
make[1]: *** [Foundation/CMakeFiles/Foundation.dir/all] Error 2
make: *** [all] Error 2
Poco/1.9.0@pocoproject/stable:
Poco/1.9.0@pocoproject/stable: ERROR: Package '69dd885229d93087ed28ec19fe62042c86f78cfc' build failed
Poco/1.9.0@pocoproject/stable: WARN: Build folder /Users/martin/.conan/data/Poco/1.9.0/pocoproject/stable/build/69dd885229d93087ed28ec19fe62042c86f78cfc
ERROR: Poco/1.9.0@pocoproject/stable: Error in build() method, line 124
    cmake.build()
    ConanException: Error 512 while executing cmake --build 'build'

I add the /Users/martin/.conan/profiles/default content if it helps:

[settings]
os=Macos
os_build=Macos
arch=x86_64
arch_build=x86_64
compiler=apple-clang
compiler.version=10.0
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]

I tried to enter the command conan profile update settings.compiler.libcxx=libstdc++11 default but it result in an error when trying to install with conan install ..:

ERROR: Invalid setting 'libstdc++11' is not a valid 'settings.compiler.libcxx' value.
Possible values are ['libc++', 'libstdc++']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"

Any idea what's going wrong?

I'm on macOS 10.14 and using conan version 1.13.0 installed via Homebrew.

All 10 comments

Hi @MartinDelille !

ERROR: Missing prebuilt package for 'Poco/1.9.0@pocoproject/stable'

It occurs because Poco team don't distribute your configuration. I'll open a PR providing a new update.

ERROR: Invalid setting 'libstdc++11' is not a valid 'settings.compiler.libcxx' value.

On Mac OS is only possible to use libstdc++ or libc++. Did you try libc++?

Regards!

It work indeed with libc++!

Hi @MartinDelille

Glad that it worked!

The error was having libstdc++ in your default profile, I would like to understand how that happened, because in theory, libc++ should be the default for OSX.

It would be useful to reproduce if you tried:

$ conan profile new mydefault --detect
$ conan profile show mydefault

And paste the output. Thanks!

Hi @memsharded,

I followed your instruction and the detect version is indeed libc++ as you can see in the output below:

$ conan profile new mydefault --detect                                                                                                              
Found apple-clang 10.0
Profile created with detected settings: /Users/martin/.conan/profiles/mydefault
$ conan profile show mydefault                                                                                                             3976ms 
Configuration for profile mydefault:

[settings]
os=Macos
os_build=Macos
arch=x86_64
arch_build=x86_64
compiler=apple-clang
compiler.version=10.0
compiler.libcxx=libc++
build_type=Release
[options]
[build_requires]
[env]

In fact what happened is that I intent to run the two following commands:

$ conan profile new default --detect  # Generates default profile detecting GCC and sets old ABI
$ conan profile update settings.compiler.libcxx=libstdc++11 default  # Sets libcxx to C++11 ABI

Since it produce an error I corrected by and from libstdc++11 to libstdc++.

I was confused by the Important note at step 6 which didn't applied in my case: I guess precising that macOS or clang user are not concerned by this information would help no?

Hi @MartinDelille

I was confused by the Important note at step 6 which didn't applied in my case: I guess precising that macOS or clang user are not concerned by this information would help no?

Do you mean the Important note that reads:

"If you are using GCC compiler >= 5.1, Conan will set the compiler.libcxx to the old ABI for backwards compatibility. You can change this with the following commands:"

With GCC compiler >= 5.1 in bold font? 馃槃 馃槄

Hi again!

Poco team just merged the improvements. The new packages will be available in few hours.

https://travis-ci.org/pocoproject/conan-poco/builds/508299242

@memsharded Ok my mistake I thought I had both compiler since gcc is in my path but I realized the it is in fact clang behind:

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

At least I learn something today! 馃槄

Hi @MartinDelille !

Please let me know if you need anything else or we are good to close this issue.

Regards!

No it's fine thank you for your help!

Was this page helpful?
0 / 5 - 0 ratings