Skip to main content
HAlzo
Associate III
August 8, 2023
Solved

Building custom library using btbake cause do_package_qa: QA Issue

  • August 8, 2023
  • 1 reply
  • 5846 views

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

This topic has been closed for replies.
Best answer by HAlzo

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

1 reply

Erwan SZYMANSKI
Technical Moderator
August 9, 2023

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
HAlzo
HAlzoAuthor
Associate III
August 9, 2023

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"

HAlzo
HAlzoAuthor
Associate III
August 9, 2023

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?