sobotklp / conan-rabbitmq-c

Conan.io package for RabbitMQ C/C++ library
MIT License
2 stars 3 forks source link

Runtime error: error loading dynamic library #4

Open Ivan-Igorevich opened 3 years ago

Ivan-Igorevich commented 3 years ago

Hello, I created this package by conan create (just because my python installation does'n see conan, and I'm not sure how to fix it) but now I have a problem launching a sample project

dyld: Library not loaded: librabbitmq.4.dylib
  Referenced from: /Users/ivan-igorevich/Desktop/AMQPSender/cmake-build-debug/bin/AMQPSender
  Reason: image not found

but I found this in conan caches:

ivan-igorevich@ivan-igorevich 9d10713d115b2f067110ae981128bd84a65dfce0 % cat install_manifest.txt 
/Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/_/_/build/9d10713d115b2f067110ae981128bd84a65dfce0/install/lib/pkgconfig/librabbitmq.pc
/Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/_/_/build/9d10713d115b2f067110ae981128bd84a65dfce0/install/lib/librabbitmq.4.0.0.dylib
/Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/_/_/build/9d10713d115b2f067110ae981128bd84a65dfce0/install/lib/librabbitmq.4.dylib
/Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/_/_/build/9d10713d115b2f067110ae981128bd84a65dfce0/install/lib/librabbitmq.dylib

here we can see, that the requested library was described for installing.

can you please help me find out what went wrong or how to fix this one?

sobotklp commented 3 years ago

A few questions to help diagnose:

What is the content of your conanfile.txt?

How are you building the sample project? Are you using cmake?

What version of conan are you using?

Ivan-Igorevich commented 3 years ago

I think I have to mention again that the package was not "built" by a build script, but it was created by conan create,

image

conanfile

[requires]
openssl/1.1.1i
rabbitmq-c/0.6.0

[generators]
txt
make

yes, cmake

conan -v
1.32.1
sobotklp commented 3 years ago

Hi again,

I'm not sure why your test project is unable to link with librabbitmq.4.dylib. Do you have something like the following in your CMakeLists.txt:

include(conanbuildinfo.cmake)
conan_basic_setup()

find_package(Rabbitmqc REQUIRED)

target_link_libraries(test ${Rabbitmqc_LIBRARY} ${CONAN_LIBS_OPENSSL})

Please try getting the latest version from git and running python3 build.py. I've updated it to use the latest version of conan_package_tools. (If you don't have that installed already, you'll need to pip3 install conan_package_tools)

Ivan-Igorevich commented 3 years ago

probably, I'm doing something completely wrong... and it's not related to this repository...

image

btw, my CMakelists is:

cmake_minimum_required(VERSION 3.17)
set(PROJECT_NAME AMQPSender)
project(${PROJECT_NAME} C)

set(CMAKE_C_STANDARD 11)
set(PLATFORM_DIR unix)

set(COMMON_SRCS
        utils.h
        utils.c
        ${PLATFORM_DIR}/platform_utils.c
        )

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
find_package(Rabbitmqc REQUIRED)

add_executable(${PROJECT_NAME} main.c ${COMMON_SRCS})

target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS} ${Rabbitmqc_LIBRARY} ${CONAN_LIBS_OPENSSL})

and is built okay...

sobotklp commented 3 years ago

Please try doing a git pull of the latest conan-rabbitmq-c from github. I've updated build.py to be compatible with the later version of conan_build_tools.

Ivan-Igorevich commented 3 years ago

after upgrading python, pip, shell, mac, conan, pack tools, myself and the world around me I made it. but...

ivan-igorevich@ivan-igorevich conan-rabbitmq-c % python3 build.py  

****************************************************************************************************

   ____ ____ _____    __   ____                          ____            _                      _____           _      __  
  / ___|  _ \_   _|  / /  / ___|___  _ __   __ _ _ __   |  _ \ __ _  ___| | ____ _  __ _  ___  |_   _|__   ___ | |___  \ \ 
 | |   | |_) || |   | |  | |   / _ \| '_ \ / _` | '_ \  | |_) / _` |/ __| |/ / _` |/ _` |/ _ \   | |/ _ \ / _ \| / __|  | |
 | |___|  __/ | |   | |  | |__| (_) | | | | (_| | | | | |  __/ (_| | (__|   < (_| | (_| |  __/   | | (_) | (_) | \__ \  | |
  \____|_|    |_|   | |   \____\___/|_| |_|\__,_|_| |_| |_|   \__,_|\___|_|\_\__,_|\__, |\___|   |_|\___/ \___/|_|___/  | |
                     \_\                                                           |___/                               /_/ 

Version: 0.35.0
 >> Branch detected
   >> master

 >> Info
   >> Redefined channel by CI branch matching with 'master$', setting CONAN_CHANNEL to 'stable'

[local_vars]
+---------------------------+----------------------------------------------------+
| Configuration             | value                                              |
|---------------------------+----------------------------------------------------|
| cwd                       | /Users/ivan-igorevich/Desktop/RSS/conan-rabbitmq-c |
| username                  | sobotklp                                           |
| skip_check_credentials    | False                                              |
| upload_only_when_stable   | False                                              |
| upload_only_when_tag      | False                                              |
| upload_only_recipe        | False                                              |
| stable_channel            | stable                                             |
| channel                   | stable                                             |
| conanfile                 | conanfile.py                                       |
| use_docker                | False                                              |
| docker_conan_home         | /home/conan                                        |
| build_policy              | missing                                            |
| sudo_docker_command       | sudo -E                                            |
| sudo_pip_command          |                                                    |
| pip_command               | pip                                                |
| docker_pip_command        | pip                                                |
| docker_shell              | /bin/sh -c                                         |
| docker_platform_param     |                                                    |
| lcow_user_workaround      |                                                    |
| exclude_vcvars_precommand | False                                              |
| upload_dependencies       |                                                    |
| update_dependencies       | False                                              |
| docker_32_images          | False                                              |
| force_selinux             | False                                              |
| conan_pip_package         | conan==1.33.1                                      |
| vs10_x86_64_enabled       | False                                              |
| builds_in_current_page    | []                                                 |
| skip_recipe_export        | False                                              |
+---------------------------+----------------------------------------------------+

 >> Running builds...

[pip_update]
Page: 1/1
+-----+-------------------+--------------+-------------+--------------------+--------+---------------------+
|   # | compiler.libcxx   | build_type   | compiler    |   compiler.version | arch   | rabbitmq-c:shared   |
|-----+-------------------+--------------+-------------+--------------------+--------+---------------------|
|   1 | libc++            | Release      | apple-clang |                9   | x86_64 | False               |
|   2 | libc++            | Debug        | apple-clang |                9   | x86_64 | False               |
|   3 | libc++            | Release      | apple-clang |                9   | x86_64 | True                |
|   4 | libc++            | Debug        | apple-clang |                9   | x86_64 | True                |
|   5 | libc++            | Release      | apple-clang |                9.1 | x86_64 | False               |
|   6 | libc++            | Debug        | apple-clang |                9.1 | x86_64 | False               |
|   7 | libc++            | Release      | apple-clang |                9.1 | x86_64 | True                |
|   8 | libc++            | Debug        | apple-clang |                9.1 | x86_64 | True                |
|   9 | libc++            | Release      | apple-clang |               10   | x86_64 | False               |
|  10 | libc++            | Debug        | apple-clang |               10   | x86_64 | False               |
|  11 | libc++            | Release      | apple-clang |               10   | x86_64 | True                |
|  12 | libc++            | Debug        | apple-clang |               10   | x86_64 | True                |
|  13 | libc++            | Release      | apple-clang |               11   | x86_64 | False               |
|  14 | libc++            | Debug        | apple-clang |               11   | x86_64 | False               |
|  15 | libc++            | Release      | apple-clang |               11   | x86_64 | True                |
|  16 | libc++            | Debug        | apple-clang |               11   | x86_64 | True                |
+-----+-------------------+--------------+-------------+--------------------+--------+---------------------+

 >> Build: 1/16

****************************************************************************************************
+-------------------------+
| Profile                 |
|-------------------------|
| include(default)        |
|                         |
| [settings]              |
| arch=x86_64             |
| build_type=Release      |
| compiler=apple-clang    |
| compiler.libcxx=libc++  |
| compiler.version=9.0    |
| [options]               |
| rabbitmq-c:shared=False |
| [env]                   |
|                         |
| [build_requires]        |
+-------------------------+

[conan_create]

 >> Calling 'conan create'
+-----------------+--------------------------------------------------------------------------------------------------+
| Configuration   | value                                                                                            |
|-----------------+--------------------------------------------------------------------------------------------------|
| name            | rabbitmq-c                                                                                       |
| version         | 0.6.0                                                                                            |
| user            | sobotklp                                                                                         |
| channel         | stable                                                                                           |
| build_modes     | ['missing']                                                                                      |
| profile_name    | /var/folders/l1/frfwzzlj73g1dtzts99_ztf40000gn/T/tmpt3bxxom6conan_package_tools_profiles/profile |
+-----------------+--------------------------------------------------------------------------------------------------+
[HOOK - attribute_checker.py] pre_export(): WARN: Conanfile doesn't have 'url'. It is recommended to add it as attribute
Exporting package recipe
rabbitmq-c/0.6.0@sobotklp/stable exports: Copied 1 '.cmake' file: FindRabbitmqc.cmake
rabbitmq-c/0.6.0@sobotklp/stable: A new conanfile.py version was exported
rabbitmq-c/0.6.0@sobotklp/stable: Folder: /Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/sobotklp/stable/export
rabbitmq-c/0.6.0@sobotklp/stable: Package recipe modified in export, forcing source folder removal
rabbitmq-c/0.6.0@sobotklp/stable: Use the --keep-source, -k option to skip it
rabbitmq-c/0.6.0@sobotklp/stable: Exported revision: 35fe67a1dc2ecf8c294b3960888051ef
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=9.0
os=Macos
os_build=Macos
[options]
rabbitmq-c:shared=False
[build_requires]
[env]

rabbitmq-c/0.6.0@sobotklp/stable: WARN: Package binary is corrupted, removing: 73e8ef4d4a5ceaba271389d156640e612348b922
rabbitmq-c/0.6.0@sobotklp/stable (test package): Installing package
Requirements
    gtest/1.8.0@bincrafters/stable from 'conan-RSS' - Cache
    openssl/1.1.1i from 'conan-RSS' - Cache
    rabbitmq-c/0.6.0@sobotklp/stable from local cache - Cache
Packages
    gtest/1.8.0@bincrafters/stable:7e0734a7c8a477ced55cec8c9e50f3c58ad81fd0 - Cache
    openssl/1.1.1i:aa84d9aecf24e625da451318795116f31a55ba90 - Cache
    rabbitmq-c/0.6.0@sobotklp/stable:73e8ef4d4a5ceaba271389d156640e612348b922 - Build

Installing (downloading, building) binaries...
gtest/1.8.0@bincrafters/stable: Already installed!
openssl/1.1.1i: Already installed!
rabbitmq-c/0.6.0@sobotklp/stable: WARN: Build folder is dirty, removing it: /Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/sobotklp/stable/build/73e8ef4d4a5ceaba271389d156640e612348b922
rabbitmq-c/0.6.0@sobotklp/stable: Configuring sources in /Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/sobotklp/stable/source
rabbitmq-c/0.6.0@sobotklp/stable: Downloading https://github.com/alanxz/rabbitmq-c/archive/v0.6.0.tar.gz...
Downloading rabbitmq-c-0.6.0.tar.gz completed [146.50k]                                  

rabbitmq-c/0.6.0@sobotklp/stable: Copying sources to build folder
rabbitmq-c/0.6.0@sobotklp/stable: Building your package in /Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/sobotklp/stable/build/73e8ef4d4a5ceaba271389d156640e612348b922
rabbitmq-c/0.6.0@sobotklp/stable: Generator cmake created conanbuildinfo.cmake
rabbitmq-c/0.6.0@sobotklp/stable: Calling build()
-- The C compiler identification is AppleClang 11.0.0.11000033
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan: Adjusting fPIC flag (ON)
-- This project seems to be plain C, using 'Clang' compiler
CMake Error at ../conanbuildinfo.cmake:510 (message):
  Detected a mismatch for the compiler version between your conan profile
  settings and CMake:

  Compiler version specified in your conan profile: 9.0

  Compiler version detected in CMake: 11.0

  Please check your conan profile settings (conan profile show
  [default|your_profile_name])

  P.S.  You may set CONAN_DISABLE_CHECK_COMPILER CMake variable in order to
  disable this check.
Call Stack (most recent call first):
  ../conanbuildinfo.cmake:612 (conan_error_compiler_version)
  ../conanbuildinfo.cmake:697 (check_compiler_version)
  ../conanbuildinfo.cmake:249 (conan_check_compiler)
  CMakeLists.txt:5 (conan_basic_setup)

-- Configuring incomplete, errors occurred!
See also "/Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/sobotklp/stable/build/73e8ef4d4a5ceaba271389d156640e612348b922/CMakeFiles/CMakeOutput.log".
See also "/Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/sobotklp/stable/build/73e8ef4d4a5ceaba271389d156640e612348b922/CMakeFiles/CMakeError.log".
rabbitmq-c/0.6.0@sobotklp/stable: 
rabbitmq-c/0.6.0@sobotklp/stable: ERROR: Package '73e8ef4d4a5ceaba271389d156640e612348b922' build failed
rabbitmq-c/0.6.0@sobotklp/stable: WARN: Build folder /Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/sobotklp/stable/build/73e8ef4d4a5ceaba271389d156640e612348b922
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/errors.py", line 34, in conanfile_exception_formatter
    yield
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/conanfile/build.py", line 16, in run_build_method
    conanfile.build()
  File "/Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/sobotklp/stable/export/conanfile.py", line 75, in build
    cmake.configure(source_folder=self.subfolder)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/build/cmake.py", line 321, in configure
    self._run(command)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/build/cmake.py", line 281, in _run
    self._conanfile.run(command)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/model/conan_file.py", line 331, in run
    raise ConanException("Error %d while executing %s" % (retcode, command))
conans.errors.ConanException: Error 1 while executing cd '/Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/sobotklp/stable/build/73e8ef4d4a5ceaba271389d156640e612348b922' && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="apple-clang" -DCONAN_COMPILER_VERSION="9.0" -DCONAN_CXX_FLAGS="-m64" -DCONAN_SHARED_LINKER_FLAGS="-m64" -DCONAN_C_FLAGS="-m64" -DCONAN_LIBCXX="libc++" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="install" -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" -DCONAN_CMAKE_POSITION_INDEPENDENT_CODE="ON" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -DOPENSSL_ROOT_DIR="/Users/ivan-igorevich/.conan/data/openssl/1.1.1i/_/_/package/aa84d9aecf24e625da451318795116f31a55ba90" -DBUILD_EXAMPLES="OFF" -DBUILD_TESTS="OFF" -DBUILD_STATIC_LIBS="True" -DCMAKE_POSITION_INDEPENDENT_CODE="True" -Wno-dev '/Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/sobotklp/stable/build/73e8ef4d4a5ceaba271389d156640e612348b922/rabbitmq-c-0.6.0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ivan-igorevich/Desktop/RSS/conan-rabbitmq-c/build.py", line 8, in <module>
    builder.run()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cpt/packager.py", line 580, in run
    self.run_builds(base_profile_name=base_profile_name)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cpt/packager.py", line 673, in run_builds
    r.run()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cpt/runner.py", line 128, in run
    self._results = self._conan_api.create(self._conanfile, name=name, version=version,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/conan_api.py", line 94, in wrapper
    return f(api, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/conan_api.py", line 386, in create
    create(self.app, ref, graph_info, remotes, update, build_modes,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/cmd/create.py", line 70, in create
    install_build_and_test(app, test_conanfile_path, ref, graph_info, remotes, update,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/cmd/test.py", line 26, in install_build_and_test
    deps_install(app=app,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/manager.py", line 77, in deps_install
    installer.install(deps_graph, remotes, build_modes, update, keep_build=keep_build,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/installer.py", line 308, in install
    self._build(nodes_by_level, keep_build, root_node, graph_info, remotes, build_mode, update)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/installer.py", line 441, in _build
    self._handle_node_cache(node, keep_build, processed_package_refs, remotes)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/installer.py", line 504, in _handle_node_cache
    pref = self._build_package(node, output, keep_build, remotes)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/installer.py", line 543, in _build_package
    pref = builder.build_package(node, keep_build, self._recorder, remotes)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/installer.py", line 232, in build_package
    raise exc
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/installer.py", line 218, in build_package
    self._build(conanfile, pref)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/installer.py", line 147, in _build
    raise exc
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/installer.py", line 139, in _build
    run_build_method(conanfile, self._hook_manager, reference=pref.ref, package_id=pref.id)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/client/conanfile/build.py", line 16, in run_build_method
    conanfile.build()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 135, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/conans/errors.py", line 40, in conanfile_exception_formatter
    raise ConanExceptionInUserConanfileMethod(msg)
conans.errors.ConanExceptionInUserConanfileMethod: rabbitmq-c/0.6.0@sobotklp/stable: Error in build() method, line 75
    cmake.configure(source_folder=self.subfolder)
    ConanException: Error 1 while executing cd '/Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/sobotklp/stable/build/73e8ef4d4a5ceaba271389d156640e612348b922' && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="apple-clang" -DCONAN_COMPILER_VERSION="9.0" -DCONAN_CXX_FLAGS="-m64" -DCONAN_SHARED_LINKER_FLAGS="-m64" -DCONAN_C_FLAGS="-m64" -DCONAN_LIBCXX="libc++" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="install" -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" -DCONAN_CMAKE_POSITION_INDEPENDENT_CODE="ON" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -DOPENSSL_ROOT_DIR="/Users/ivan-igorevich/.conan/data/openssl/1.1.1i/_/_/package/aa84d9aecf24e625da451318795116f31a55ba90" -DBUILD_EXAMPLES="OFF" -DBUILD_TESTS="OFF" -DBUILD_STATIC_LIBS="True" -DCMAKE_POSITION_INDEPENDENT_CODE="True" -Wno-dev '/Users/ivan-igorevich/.conan/data/rabbitmq-c/0.6.0/sobotklp/stable/build/73e8ef4d4a5ceaba271389d156640e612348b922/rabbitmq-c-0.6.0'