sysrepo / sysrepo-cpp

C++ bindings for the sysrepo library
BSD 3-Clause "New" or "Revised" License
7 stars 6 forks source link

libyang-cpp not found #10

Closed olegzharov closed 2 years ago

olegzharov commented 2 years ago

Hi! I try to build this and I got an error:

$ cmake .. -- Checking for modules 'libyang-cpp=1.1.0;libyang-cpp' -- No package 'libyang-cpp' found -- No package 'libyang-cpp' found CMake Error at /usr/local/share/cmake-3.23/Modules/FindPkgConfig.cmake:603 (message): A required package was not found Call Stack (most recent call first): /usr/local/share/cmake-3.23/Modules/FindPkgConfig.cmake:825 (_pkg_check_modules_internal) CMakeLists.txt:30 (pkg_check_modules) -- Configuring incomplete, errors occurred!

but just before I installed "libyang-cpp" as well:

$ sudo make install [ 58%] Built target yang-cpp [ 66%] Built target DoctestIntegration [ 75%] Built target test_context [ 83%] Built target test_data_node [ 91%] Built target test_schema_node [100%] Built target test_unsafe Install the project... -- Install configuration: "" -- Up-to-date: /usr/local/lib64/libyang-cpp.so -- Up-to-date: /usr/local/include/libyang-cpp -- Up-to-date: /usr/local/include/libyang-cpp/ChildInstantiables.hpp -- Up-to-date: /usr/local/include/libyang-cpp/Collection.hpp -- Up-to-date: /usr/local/include/libyang-cpp/Context.hpp -- Up-to-date: /usr/local/include/libyang-cpp/DataNode.hpp -- Up-to-date: /usr/local/include/libyang-cpp/Enum.hpp -- Up-to-date: /usr/local/include/libyang-cpp/Module.hpp -- Up-to-date: /usr/local/include/libyang-cpp/SchemaNode.hpp -- Up-to-date: /usr/local/include/libyang-cpp/Set.hpp -- Up-to-date: /usr/local/include/libyang-cpp/Type.hpp -- Up-to-date: /usr/local/include/libyang-cpp/Utils.hpp -- Up-to-date: /usr/local/include/libyang-cpp/Value.hpp -- Up-to-date: /usr/local/lib64/pkgconfig/libyang-cpp.pc

olegzharov commented 2 years ago

even when I check it with ldconfig: $ sudo ldconfig -p | grep yang libyang.so.2 (libc6,x86-64) => /usr/local/lib64/libyang.so.2 libyang.so.2 (libc6,x86-64) => /lib64/libyang.so.2 libyang.so (libc6,x86-64) => /usr/local/lib64/libyang.so libyang.so (libc6,x86-64) => /lib64/libyang.so libyang-cpp.so (libc6,x86-64) => /usr/local/lib64/libyang-cpp.so

syyyr commented 2 years ago

Hi we're using pkgconfig to find libyang-cpp. Please refer to this thread for instructions on how to tell cmake where your libraries are installed. Specifically this comment should help you.

Let me know if you have any more questions.

olegzharov commented 2 years ago

Solved, /usr/local was not in pkg-config PATH