PkgConfig cannot find directfb
-
The project uses CMake to build an embedded Linux environment.
The initial development runs on a Linux desktop. It was working. I renamed a parent folder to avoid scripting issues between two development environments.
I am building on Ubuntu 16.04 inside of VS-Code It generates the output:
[cmake] Qt version: 5.5.1
[cmake] -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
[cmake] -- Checking for module 'directfb'
[cmake] -- No package 'directfb' found
[cmake] -- Configuring incomplete, errors occurred!When I ran sudo apt-get install -y libdirectfb-1.2-9 it showed
libdirectfb-1.2-9 is already the newest version (1.2.10.0-5.1).
It is installed in /usr/lib/x86_64-linux-gnu/directfb-1.2-9/How do I tell my environment (env or VS-Code) how to find the directfb library?
-
@JoeA-B said in PkgConfig cannot find directfb:
Both pkgconf and pkg-config show directfb DirectFB. I do not know how to create a custom .pc file
then does your CMAKE project even use pkgconfig to look for the directfb lib?
e.g. with https://cmake.org/cmake/help/latest/module/FindPkgConfig.html
If so try adding the path/usr/lib/x86_64-linux-gnu/pkgconfig
to thePKG_CONFIG_PATH
env variableand cannot do a direct link.
why not? pkgconfig simply provides the flags used for linking, like you would do when linking against it "manually"
-
Hi,
Your version of DirectFB may possibly not provide a pkg-config file. Do you have a directfb.pc file somewhere in your machine ?
-
@JoeA-B
this package doesn't contain a pc file: https://packages.ubuntu.com/xenial/amd64/libdirectfb-1.2-9/filelistTo make pkgconf find this library you can create a custom .pc file (in one of pkgconf's search paths) or simply link against it directly like you would do with any other library.
-
@raven-worx I do not understand. Both pkgconf and pkg-config show directfb DirectFB. I do not know how to create a custom .pc file and cannot do a direct link.
-
@JoeA-B said in PkgConfig cannot find directfb:
Both pkgconf and pkg-config show directfb DirectFB. I do not know how to create a custom .pc file
then does your CMAKE project even use pkgconfig to look for the directfb lib?
e.g. with https://cmake.org/cmake/help/latest/module/FindPkgConfig.html
If so try adding the path/usr/lib/x86_64-linux-gnu/pkgconfig
to thePKG_CONFIG_PATH
env variableand cannot do a direct link.
why not? pkgconfig simply provides the flags used for linking, like you would do when linking against it "manually"
-
@raven-worx I got it to work but am still not sure how setting PKG_CONFIG_PATH helped.
Why not link? I am adding a module to a full operating system and cannot control the rest of the configuration.
-
@JoeA-B said in PkgConfig cannot find directfb:
Why not link? I am adding a module to a full operating system and cannot control the rest of the configuration
still a simple
-ldirectfb
parameter should work on all systems, when the plugin is in a default lib directory (which/usr/lib/x86_64-linux-gnu
is btw for example on Debian/Ubuntu)