[SOLVED] How to add and compile my QT application in Yocto image (which contains QT-5 layer.)?


I am trying to add a qt widgets application/project to my yocto image and compile it through it. I know that I have to add a custom layer and make a recipe which has reference to the files of the qt application. I have also inherited qmake5 and inserted DEPENDS += "qtbase", but I am confused about which files to refer through SRC_UI in my recipe. The QT application file is a bare bone project called "hi" which contains no additional code and pops up a plain helloworld window. The project file contains following files:


A reference recipe using above mentioned files would be really helpful.Thanks.


I have an old response about QT recipes in Yocto.

Check: how to build simple qt application using yocto?

It contains a reference hello world recipe.

You just need to copy your files into recipes’ folder and specify all files in SRC_URI or:

If your project is collected under one folder hi:

Place hi under: qtexample/files and specify it in the recipe:

SRC_URI = "file://hi"
S = "${WORKDIR}/hi"


Do not forget to mention the files to package:

FILES_${PN} = "/opt/*"


If your recipe depends on a library or set of tools at run time, check what recipes are providing those libraries and add in your recipe:

RDEPENDS_${PN} += "recipe"

where recipe is what providing your runtime dependency.

Answered By – Talel BELHADJSALEM

Answer Checked By – Cary Denson (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *