Qt Forum

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

    Unsolved How to solve a missing pkg-config command

    Tools
    mac-os pkg-config
    4
    14
    21925
    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.
    • a.burks
      a.burks last edited by koahnig

      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 Reply Quote 0
      • K
        koahnig @a.burks last edited by

        @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 Reply Quote 0
        • a.burks
          a.burks last edited by

          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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 1
            • a.burks
              a.burks last edited by

              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 Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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.burks 1 Reply Last reply Reply Quote 0
                • M
                  mostefa last edited by 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.burks 1 Reply Last reply Reply Quote 0
                  • a.burks
                    a.burks @mostefa last edited by 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 2 Replies Last reply Reply Quote 0
                    • M
                      mostefa @a.burks last edited by

                      @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.burks 1 Reply Last reply Reply Quote 0
                      • a.burks
                        a.burks @SGaist last edited by

                        @SGaist After opening the project in Qt Creator

                        0_1512302993940_Screenshot build.jpg

                        1 Reply Last reply Reply Quote 0
                        • a.burks
                          a.burks @mostefa last edited by

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

                          1 Reply Last reply Reply Quote 0
                          • M
                            mostefa @a.burks last edited by

                            @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.burks 1 Reply Last reply Reply Quote 0
                            • a.burks
                              a.burks @mostefa last edited by

                              @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 Reply Quote 0
                              • a.burks
                                a.burks last edited by

                                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 Reply Quote 0
                                • First post
                                  Last post