简体   繁体   中英

Qt Creator on MacOS: pkg-config dependencies can't be found

I already tried all the solutions here , but I continue to get the following error when I issue the command "Run qmake" on my project from Qt Creator on Qt 5.6.1:

Project ERROR: grpc++ development package not found

... Yet, on the console, qmake && make clean && make successfully builds the project with no errors.

which qmake returns /usr/local/bin/qmake and qmake --version returns

QMake version 3.0
Using Qt version 5.6.1 in /usr/local/Cellar/qt5/5.6.1-1/lib

Here is my environment:

  • macOS Sierra
  • Qt SDK 5.7 (to get the latest version of Qt Creator)
  • Homebrew installed Qt 5.6.1 (I need 5.6.x specifically for ABI compatibility)
  • Dependencies grpc++ , libsndfile , protobuf all installed via Homebrew in /usr/local and the .pc files are in /usr/local/lib/pkgconfig

When I open up a new terminal and type pkg-config --cflags --libs grpc++ , I get the correct result back with no error message.

I'm trying to build this software, of which I am the primary author/maintainer: https://github.com/allquixotic/kynnaugh-cc

See the .pro file for details of how I'm telling it to use pkg-config.

  • I've tried the launchd.conf hack from here (and rebooted the Mac after updating it).
  • I've tried the /etc/paths.d/local hack from the same question, to no avail.
  • My .pro file has QT_CONFIG -= no-pkg-config .
  • I tried setting the env var PKG_CONFIG_PATH=/usr/local/lib/pkgconfig explicitly in the "Manage Kits" GUI of Qt Creator for the Qt 5.6.1 toolchain that I'm using, but it didn't change the errant behaviour.

Are there any other ways I can attempt to diagnose the problem, or can you spot an error in my .pro file, or is there a better solution to this problem than what I've attempted thus far?

I'm asking this as a new question because the solutions in that other question don't work , so I may very well be having a completely different problem despite extremely similar symptoms.

Turns out the PATH variable in Qt Creator wasn't picking up /usr/local/bin. Adding it manually to the project config fixed my issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM