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
QtWS25 Last Chance

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 33.8k 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.burksA Offline
    a.burksA Offline
    a.burks
    wrote on last edited by koahnig
    #1

    I can't build a project in Qt Creator for macOS because of the following problem:

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

    I tried to install pkg-config with brew and learned, that this library is already installed at /usr/local/bin/pkg-config.

    How can I solve this problem?

    K 1 Reply Last reply
    0
    • a.burksA a.burks

      I can't build a project in Qt Creator for macOS because of the following problem:

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

      I tried to install pkg-config with brew and learned, that this library is already installed at /usr/local/bin/pkg-config.

      How can I solve this problem?

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @a.burks

      You need togive more details on actual versions of OS and Qt.

      Is this a fresh installation?
      Did you try to reinstall Qt creator respectively complete Qt?

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • a.burksA Offline
        a.burksA Offline
        a.burks
        wrote on last edited by
        #3

        Thanks for your response. I appreciate the time you have invested.

        I'm working on macOS 10.13.1 High Sierra and Qt Creator 4.2.1 (Sailfish OS SDK 1710) based on Qt 5.6.2 (Clang 6.0 (Apple), 64 bit).

        I did run an update yesterday with the maintenance tool. But the problem occured in the last versios, either. So far I relized, the maintenance tool replaces the existing installation for a major update.

        I also tried to clean the project and to close and restart Qt Creator. I assume, that the library pkg-config is linked to the wrong path somewhere. But I don't know, where the library is linked, in the Qt Creator itself or in the project. It is also possible that the library is missed on the virtual machine for thebuild process, that is included in the SDK for SailfishOS.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          You can use something like macports or brew to install additional tools that might be missing.

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

          1 Reply Last reply
          1
          • a.burksA Offline
            a.burksA Offline
            a.burks
            wrote on 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
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on 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.burksA 1 Reply Last reply
              0
              • M Offline
                M Offline
                mostefa
                wrote on last edited by mostefa
                #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.burksA 1 Reply Last reply
                0
                • M mostefa

                  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.burksA Offline
                  a.burksA Offline
                  a.burks
                  wrote on last edited by a.burks
                  #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
                  0
                  • a.burksA a.burks

                    @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 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.burksA 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      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.burksA Offline
                      a.burksA Offline
                      a.burks
                      wrote on last edited by
                      #10

                      @SGaist After opening the project in Qt Creator

                      0_1512302993940_Screenshot build.jpg

                      1 Reply Last reply
                      0
                      • M mostefa

                        @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.burksA Offline
                        a.burksA Offline
                        a.burks
                        wrote on last edited by
                        #11

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

                        1 Reply Last reply
                        0
                        • a.burksA a.burks

                          @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 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.burksA 1 Reply Last reply
                          0
                          • M mostefa

                            @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.burksA Offline
                            a.burksA Offline
                            a.burks
                            wrote on 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.burksA Offline
                              a.burksA Offline
                              a.burks
                              wrote on 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

                              • Login

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