Cargo cannot find lib even though the lib exists

During the process of baking my own recipe in yocto project (rust app with gtk3) I'm getting the following error:

cargo:warning=Could not run "pkg-config" "--libs" "--cflags" "glib-2.0" "glib-2.0 >= 2.48"

If I check for the package I get:

pkg-config --libs --cflags glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lglib-2.0

Anyone knows what to do to inform cargo about those libs?

What does it prints if you type the exact same command as the cargo did?

pkg-config --libs --cflags glib-2.0 'glib-2.0 >= 2.48'

-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lglib-2.0

And cargo build on the same shell fails with the message above? If so that means your environment is in some unusual state and it's hard to tell what's the problem without checking the whole project.

Project can be build normally from command line. The important thing here is that when yocto tries to build it that happens.

You will need to install glib into whatever build environment yocto uses I think.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.