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

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.

Related

Why is `qmake -v` version not changing after installing later version?

I'm updating my version of Qt for development purposes on my mac.
So I downloaded and installed the opens-source .dmg from the Qt website (https://www.qt.io/).
During installation, I specifically checked the box to install version 5.0.2.
But afterwards, when running qmake -v, it still says the version is 4.8.7.
Make version 2.01a
Using Qt version 4.8.7 in /Users/my_dir/anaconda/lib
(Note: it also points to /lib directory in /anaconda, even though I'm setting this up for Rails purposes. Not sure if this has any impact.)
Can anyone advise how I can change the version that is being pointed to?
Below is what worked for me, incase anyone else has this issue.
Check which version of qmake is being used. which qmake.
Remove anaconda from mac $PATH.
Force homebrew to symlink binaries. brew link --force qt55.
Re-check which version of qmake is being used. which qmake.
When you check the version of qmake the second time, it should point to the new version of qmake that you have installed.
Note: You will have to redo this for every terminal session where you want to use the newer version of qmake.

How to minimize install of Qt for using PyQt on MacOS?

I was trying to install PyQt on my MacOS. With SIP installed, an error occurred when python3 PyQt-gpl-5.4/configure.py inputted:
Error: Use the --qmake argument to explicitly specify a working Qt qmake.
It seems that Qt should be installed before PyQt. There're many optional components in the installation of Qt:
-Qt 5.4
--clang 64-bit
--source components
---Add-Ons
---Essentials
--.....
Which components should I choose for installing qmake??
qmake is the executable that is included with any version of the qt libraries; and there is a different version of qmake for each compiler the Qt Libraries are built with/against. On a mac, and for building projects that run on OSX, you will probably want clang x64. And you will find qmake under ~/Qt/5.x/clang_64/bin It will also install qt creator (I don't think you can uncheck it), but you don't need all the extras besides that.
Building with qmake often needs XCode installed and the Command Line Tools (CLT) to use its included compiler. With Python, you probably won't need the compiler, unless you need to build some of its libraries.
Hope that helps.

Haskell wx fails install Macosx

I was trying to get wxHaskell installed on my mac (Osx Mavericks). I fixed the issue with gcc, and I used brew to install wxmac (version 3.0). The issue that keeps coming up is that the hackage cabal searches for looks for wx 2.9, while I have 3.0. It says that it can't find:
Warning: No config found to match: /usr/local/bin/wx-config --version=2.9 --version-full
in /usr/local/Cellar/wxmac/3.0.0.0/lib/wx/config
If you require this configuration, please install the desired
library build. If this is part of an automated configuration
test and no other errors occur, you may safely ignore it.
You may use wx-config --list to see all configs available in
the default prefix.
I can't find any way to install a different version of wx through brew. Does anyone have a fix?
Thanks!

Using CMake with Qt + brew OSX

I am using a homebrew installed version of Qt(4.8.5) with CMake. The detection process in producing a strange QT_INCLUDE_DIR value of
/usr/local/Cellar/qt/4.8.5/include/usr/local/Cellar/qt/4.8.5/lib/QtCore.framework
This location does not exist and QT headers are not found by Xcode. Is this an issue with brew CMake recipes ? What would be a logical fix in the CMakeLists for the project.

CMake Xcode generator uses no longer supported options

I'm trying to make a Xcode project from the Insight Toolkit (ITK, itk.org). I issued the following command into the terminal:
ccmake -DCMAKE_C_COMPILER=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -DCMAKE_CXX_COMPILER=/Applications/Xcode.app/Contents/Developer/usr/bin/g++ -GXcode /<path to source>
When I try to generate the project it fails with this error:
CMake Error at /Applications/CMake 2.8-7.app/Contents/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "/Applications/Xcode.app/Contents/Developer/usr/bin/gcc" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /<path to destination folder>/CMakeFiles/CMakeTmp
Run Build Command:/Applications/CMake\ 2.8-7.app/Contents/bin/cmakexbuild -project CMAKE_TRY_COMPILE.xcode build -target cmTryCompileExec -buildstyle Development
xcodebuild: error: option '-buildstyle' is no longer supported
How can I configure the call to cmakexbuild? I haven't found a respective entry in the CMake configuration menu.
I have found similar problems from other users with other projects so I assume it's a problem with the CMake configuration.
I'm using Xcode 4.3 and CMake 2.8.7 on Mac OS X Lion 10.7.3.
Thanks for your help,
Paul
It's a CMake bug and it seem to be been fixed in development version:
http://public.kitware.com/Bug/view.php?id=12621
You can fix this by telling OSX which version of Xcode you want to use. If you installed 4.3, it has moved to the Apps folder, along with all the tools. Previously they were all in /Developer. Do the following and try again.
sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer
You may also have to install the command-line tools. I already installed these so I don't know what will happen without them.
cmake 2.8.8 rc1 is out now. Perhaps try that. I think it has solved my problem. :)

Resources