2023-08-08 07:24 AM - edited 2023-08-09 01:38 AM
I have STM32MP157A-DK1 board
I am using distribution package.
I want to add c++ library based on cmake to my distribution.
I crated the recipe using command
devtool add --no-same-dir ../pass/to/mylib
Then build using
bitbake mylib
The build is done but I get this error bu do_package_qa
"do_package_qa: QA Issue: -dev package mylib-dev contains non-symlink .so '/usr/lib/mylib.so' [dev-elf]"
what is the reason for such error and how to overcome it?
Thanks
Hossam
Solved! Go to Solution.
2023-08-10 09:14 AM - edited 2023-08-10 09:17 AM
According to Yocto Documentation, the cause of the problem is that my library is not versioned, So In order to solve this problem I should follow the procedure mentioned in documentation or version my library.
so I added the following line in my cmake file in order to add version to mylibrary.
set_target_properties(MyLib PROPERTIES VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})
Thanks for support
2023-08-09 07:07 AM
Hello @HAlzo ,
Is it possible for you to share me a tarball containing the recipe that you try to add to your distribution ?
It will be much easier for me to understand what happens from your side.
Kind regards,
Erwan.
2023-08-09 08:34 AM - edited 2023-08-09 08:35 AM
Hello @Erwan SZYMANSKI
The recipe Just Inherited cmake,
****************************************************************************************************************
# Recipe created by recipetool
# This is the basis of a recipe and may need further editing in order to be fully functional.
# (Feel free to remove these comments when editing.)
# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is
# your responsibility to verify that the values are complete and correct.
#
# The following license files were not able to be identified and are
# represented as "Unknown" below, you will need to check them yourself:
# License.txt
LICENSE = "Unknown"
LIC_FILES_CHKSUM = "file://License.txt;md5=bfb3fb7d9ce5a2d4ede730545d2380c1"
# No information for SRC_URI yet (only an external source tree was specified)
SRC_URI = ""
DEPENDS = "opencv"
# NOTE: unable to map the following CMake package dependencies: OpenCV
inherit cmake
# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
EXTRA_OECMAKE = ""
****************************************************************************************************************
I just added DEPENDS = "opencv"
2023-08-09 10:04 AM
Hi @Erwan SZYMANSKI,
My project cmake file "CMakelists.txt" produces 3 outputs, one shared library and two application based on this shared library.
I modified the CMakelists.txt to generate the library only and it worked without generating the error.
Then I modified it to generate each of the applications -once at a time- by compiling and linking the library source with the application source directly and it worked correctly.
It seam that the problem when cmake file has more than one target. or when linking against developed shared library!
Should I use 3 CMakeLists.txt and generate 3 .bb recipes using "devtool add" three times, in order to generate the 3 binaries in my image?
2023-08-09 01:15 PM - edited 2023-08-09 01:16 PM
@HAlzo ,
I did not manipulate CMake with Yocto so much to have a clear idea of what happens exactly. But with you explanation I understand better what you do know.
Did you already check online if any solution could fit with your issue, as it is more a "Yocto problem" than a "ST problem" ?
I just have seen a similar case online.
FILES_SOLIBSDEV = ""
FILES_${PN} += "${libdir}/mylib.so"
Adding this in your recipe will probably make the trick.
Kind regards,
Erwan.
2023-08-10 06:13 AM
@Erwan SZYMANSKI
I get different error
do_package: QA Issue: tof: Files/directories were installed but not shipped in any package: /usr/lib/libxxx.so
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
2023-08-10 07:40 AM - edited 2023-08-10 07:41 AM
@HAlzo ,
Note that the precedent example gotten from the online topic seems to be written in "Dunfell style". For a "kirkstone" or a "mickledore" style, it will be something like:
FILES:${PN} += "${libdir}/mylib.so"
Kind regards,
Erwan.
2023-08-10 09:14 AM - edited 2023-08-10 09:17 AM
According to Yocto Documentation, the cause of the problem is that my library is not versioned, So In order to solve this problem I should follow the procedure mentioned in documentation or version my library.
so I added the following line in my cmake file in order to add version to mylibrary.
set_target_properties(MyLib PROPERTIES VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})
Thanks for support
2023-08-10 11:48 PM
Hello @HAlzo ,
Thank you for your feedback concerning your correction !
Please do not hesitate to put your own solution as "Accepted Solution" to help other community member with a similar issue.
Kind regards,
Erwan.