Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to solve a missing pkg-config command
Forum Update on Monday, May 27th 2025

How to solve a missing pkg-config command

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
mac-ospkg-config
14 Posts 4 Posters 34.2k Views
  • 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.
  • A Offline
    A Offline
    a.burks
    wrote on 2 Dec 2017, 17:06 last edited by
    #5

    I did have the same idea. Unfortunately the package seems to exist already:

    Warning: pkg-config 0.29.2 is already installed, it's just not linked.
    You can use `brew link pkg-config` to link this version.
    

    I did run the command, but there is a conflict:

    Error: Could not symlink bin/pkg-config
    Target /usr/local/bin/pkg-config
    already exists. You may want to remove it:
      rm '/usr/local/bin/pkg-config'
    
    To force the link and overwrite all conflicting files:
      brew link --overwrite pkg-config
    
    To list all files that would be deleted:
      brew link --overwrite --dry-run pkg-config
    

    The list of the last command:

    Would remove:
    /usr/local/bin/pkg-config
    /usr/local/share/aclocal/pkg.m4
    /usr/local/share/doc/pkg-config/pkg-config-guide.html
    /usr/local/share/man/man1/pkg-config.1
    

    It seems that Qt Creator or the project - I don't know - expects the pkg-config in a different path namely /bin/sh.

    I also don't know, whether QT Creator of the SailfishOS SDK expects or the project itself expects pkg-config on my host, where Qt Creator is installed, or on the build engine on the virtual machine.

    I would appreciate any help.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 2 Dec 2017, 20:48 last edited by
      #6

      The /bin/sh part refers to the bash interpreter used to call pkg-config.

      I don't know, I haven't used that SDK at all. Where to you see that message printed ?

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

      A 1 Reply Last reply 3 Dec 2017, 12:10
      0
      • M Offline
        M Offline
        mostefa
        wrote on 2 Dec 2017, 21:03 last edited by mostefa 12 Feb 2017, 21:19
        #7

        Hi @a-burks

        i was facing one similar problem with pkg-config, with one qt project (i am not sure , but maybe it is the same problem for you)

        and for me the problem was due to missing build var environment in Qt Creator

        So to solve this problem i have added pkg-config path with this following steps:

        1. From Qt creator , go to project mode.
        2. In build environment add var:

        PKG_CONFIG_PATH

        And for the value of this variable , you have to add the path to pkgconfig, i think that in your case this should be equal to :

        /usr/local/bin/pkg-config

        Are you having this error only with one qt project? or with all qt project?

        A 1 Reply Last reply 3 Dec 2017, 11:58
        0
        • M mostefa
          2 Dec 2017, 21:03

          Hi @a-burks

          i was facing one similar problem with pkg-config, with one qt project (i am not sure , but maybe it is the same problem for you)

          and for me the problem was due to missing build var environment in Qt Creator

          So to solve this problem i have added pkg-config path with this following steps:

          1. From Qt creator , go to project mode.
          2. In build environment add var:

          PKG_CONFIG_PATH

          And for the value of this variable , you have to add the path to pkgconfig, i think that in your case this should be equal to :

          /usr/local/bin/pkg-config

          Are you having this error only with one qt project? or with all qt project?

          A Offline
          A Offline
          a.burks
          wrote on 3 Dec 2017, 11:58 last edited by a.burks 12 Mar 2017, 12:05
          #8

          @mostefa Thanks for the recommendation. This is my configuration, I've checked:

          0_1512302728337_Screenshot_SailfishOS_SDK.jpg

          I'm afraid, that the parameter is ignored. I get the same error message:

          /bin/sh: pkg-config: command not found
          
          M 2 Replies Last reply 3 Dec 2017, 12:05
          0
          • A a.burks
            3 Dec 2017, 11:58

            @mostefa Thanks for the recommendation. This is my configuration, I've checked:

            0_1512302728337_Screenshot_SailfishOS_SDK.jpg

            I'm afraid, that the parameter is ignored. I get the same error message:

            /bin/sh: pkg-config: command not found
            
            M Offline
            M Offline
            mostefa
            wrote on 3 Dec 2017, 12:05 last edited by
            #9

            @a.burks said in How to solve a missing pkg-config command:

            @mostefa Thanks for the recommendation. This is my configuration, I've checked:

            ![0_1512302492091_Screenshot_SailfishOS_SDK.jpg](Uploading 100%)

            I'm afraid, that the parameter is ignored. I get the same error message:

            /bin/sh: pkg-config: command not found
            

            Your screenshot is not visible ?

            A 1 Reply Last reply 3 Dec 2017, 12:18
            0
            • S SGaist
              2 Dec 2017, 20:48

              The /bin/sh part refers to the bash interpreter used to call pkg-config.

              I don't know, I haven't used that SDK at all. Where to you see that message printed ?

              A Offline
              A Offline
              a.burks
              wrote on 3 Dec 2017, 12:10 last edited by
              #10

              @SGaist After opening the project in Qt Creator

              0_1512302993940_Screenshot build.jpg

              1 Reply Last reply
              0
              • M mostefa
                3 Dec 2017, 12:05

                @a.burks said in How to solve a missing pkg-config command:

                @mostefa Thanks for the recommendation. This is my configuration, I've checked:

                ![0_1512302492091_Screenshot_SailfishOS_SDK.jpg](Uploading 100%)

                I'm afraid, that the parameter is ignored. I get the same error message:

                /bin/sh: pkg-config: command not found
                

                Your screenshot is not visible ?

                A Offline
                A Offline
                a.burks
                wrote on 3 Dec 2017, 12:18 last edited by
                #11

                @mostefa Yes, the file was too large. Now it should be visible.

                1 Reply Last reply
                0
                • A a.burks
                  3 Dec 2017, 11:58

                  @mostefa Thanks for the recommendation. This is my configuration, I've checked:

                  0_1512302728337_Screenshot_SailfishOS_SDK.jpg

                  I'm afraid, that the parameter is ignored. I get the same error message:

                  /bin/sh: pkg-config: command not found
                  
                  M Offline
                  M Offline
                  mostefa
                  wrote on 3 Dec 2017, 12:19 last edited by
                  #12

                  @a.burks said in How to solve a missing pkg-config command:

                  @mostefa Thanks for the recommendation. This is my configuration, I've checked:

                  0_1512302728337_Screenshot_SailfishOS_SDK.jpg

                  I'm afraid, that the parameter is ignored. I get the same error message:

                  /bin/sh: pkg-config: command not found
                  

                  From a quick search on stackoverflow , i think that you are facing this problem too

                  https://stackoverflow.com/a/20805469

                  Can you try then to add

                  PKG_CONFIG = /usr/local/bin/pkg-config

                  Inside your .pro?

                  A 1 Reply Last reply 10 Dec 2017, 00:28
                  0
                  • M mostefa
                    3 Dec 2017, 12:19

                    @a.burks said in How to solve a missing pkg-config command:

                    @mostefa Thanks for the recommendation. This is my configuration, I've checked:

                    0_1512302728337_Screenshot_SailfishOS_SDK.jpg

                    I'm afraid, that the parameter is ignored. I get the same error message:

                    /bin/sh: pkg-config: command not found
                    

                    From a quick search on stackoverflow , i think that you are facing this problem too

                    https://stackoverflow.com/a/20805469

                    Can you try then to add

                    PKG_CONFIG = /usr/local/bin/pkg-config

                    Inside your .pro?

                    A Offline
                    A Offline
                    a.burks
                    wrote on 10 Dec 2017, 00:28 last edited by
                    #13

                    @mostefa Unfortunately this has no impact. I get the same output. This is, how the *.pro file looks like:

                    TEMPLATE = subdirs
                    SUBDIRS += src plugin tools tests doc
                    
                    plugin.depends = src
                    tools.depends = src
                    tests.depends = src
                    
                    PKG_CONFIG = /usr/local/bin/pkg-config
                    
                    QMAKE_CLEAN += \
                        build-stamp \
                        configure-stamp \
                        artifacts/*.deb \
                        *.log.xml \
                        *.log
                    
                    QMAKE_DISTCLEAN += \
                        build-stamp \
                        configure-stamp \
                        *.log.xml \
                        *.log
                    
                    PKG_CONFIG = /usr/local/bin/pkg-config
                    

                    The output is still the following:

                    /bin/sh: pkg-config: command not found
                    
                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      a.burks
                      wrote on 16 Dec 2017, 15:53 last edited by
                      #14

                      I posted the issue in GitHib. Unfortunately I can't understand the answer. Can someone help?

                      Building a Mer/Sailfish OS project within Qt Creator relies on the definition and use of qtc_* macros inside the .spec file, which is not the case of lipstick library. Opened #122 to let mb2 issue warning when qtc_* macros are not used in the .spec file.

                      1 Reply Last reply
                      0

                      14/14

                      16 Dec 2017, 15:53

                      • Login

                      • Login or register to search.
                      14 out of 14
                      • First post
                        14/14
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved