Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    Solved PkgConfig cannot find directfb

    Mobile and Embedded
    pkgconfig directfb cmake 5.5.1 ubuntu
    3
    8
    620
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      JoeA.B last edited by

      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?

      raven-worx 1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators @JoeA.B last edited by raven-worx

        @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 the PKG_CONFIG_PATH env variable

        and cannot do a direct link.

        why not? pkgconfig simply provides the flags used for linking, like you would do when linking against it "manually"

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        J 1 Reply Last reply Reply Quote 2
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Hi,

          Your version of DirectFB may possibly not provide a pkg-config file. Do you have a directfb.pc file somewhere in your machine ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          J 1 Reply Last reply Reply Quote 0
          • J
            JoeA.B @SGaist last edited by

            @SGaist I found the file: /usr/lib/x86_64-linux-gnu/pkgconfig/directfb.pc. My interface project built today but my OS image failed to build. Neither mentioned directfb.

            1 Reply Last reply Reply Quote 0
            • raven-worx
              raven-worx Moderators @JoeA.B last edited by

              @JoeA-B
              this package doesn't contain a pc file: https://packages.ubuntu.com/xenial/amd64/libdirectfb-1.2-9/filelist

              To 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.

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              J 1 Reply Last reply Reply Quote 0
              • J
                JoeA.B @raven-worx last edited by

                @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.

                raven-worx 1 Reply Last reply Reply Quote 0
                • raven-worx
                  raven-worx Moderators @JoeA.B last edited by raven-worx

                  @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 the PKG_CONFIG_PATH env variable

                  and cannot do a direct link.

                  why not? pkgconfig simply provides the flags used for linking, like you would do when linking against it "manually"

                  --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                  If you have a question please use the forum so others can benefit from the solution in the future

                  J 1 Reply Last reply Reply Quote 2
                  • J
                    JoeA.B @raven-worx last edited by

                    @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.

                    raven-worx 1 Reply Last reply Reply Quote 0
                    • raven-worx
                      raven-worx Moderators @JoeA.B last edited by raven-worx

                      @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)

                      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                      If you have a question please use the forum so others can benefit from the solution in the future

                      1 Reply Last reply Reply Quote 2
                      • First post
                        Last post