To connect the appropriate version of a shared library from a Yocto recipe, one can:
Include the shared library in the recipe by adding it to the recipe's FILES
variable.
Set the library's version using the PN-${PV}
variable. For example, PN-${PV}.so.1
.
Use the pkg-config
tool to locate and link against the library.
Specify the library's path in the linker flags using the -L
option, and the library's name using the -l
option.
For example, if the shared library is named libfoo.so.1
, and its Yocto recipe installs it to /usr/lib
, one can connect to it by including these flags in a CMake target:
add_executable(my_target my_source.cpp)
target_link_libraries(my_target
-L/usr/lib
-lfoo
)
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-06-19 13:30:02 +0000
Seen: 20 times
Last updated: Jun 19 '23
What is the procedure for utilizing the node-rdpjs library?
How can libxml++ library be added to cmake?
What's the process of connecting an LLVM pass to an external library?
Using CMake, what is the process to include a pre-existing static library in a project?
What is an alternative J2me datamatrix decoder library to Zxing that I can use?
How can I add a method to the Eigen library using EIGEN_MATRIXBASE_PLUGIN?
Can the MUI DatePicker be utilized for dates without the dependence on a 3rd party library?