Josh
Josh

Reputation: 2444

[email protected] works, but not Qt

Attempting to run qt on my Mac, using the following homebrew commands:

no errors occured. However, when I tried running qt-creator, I noticed I had to manually link qmake. When I attempted to run my program, I got the following error:

:-1: error: failed to parse default search paths from compiler output

After attempting to add qt to the environment variables, it did not work.

What I finally resorted to was the following:

Still, I had to manually link qmake, but this time it worked.

Question: Why does [email protected] work, and not qt? Is there a fix/way to get qt to work?

Upvotes: 3

Views: 2027

Answers (1)

Will
Will

Reputation: 2488

I just ran into this issue, with a brand new homebrew install of qt and qt-creator.

The short answer is make sure your selected "Kit" is using Clang. It can default to gcc and cause this error.

Longer answer:

  1. Go to "Preferences → Build and Run → Qt Versions" and ensure you have a path to your qmake binary.
    • For my homebrew install, it was /usr/local/Cellar/qt/5.11.1/bin/qmake (+SHIFT+G in the open-file dialog).
  2. Click OK, then re-navigate to "Preferences → Build and Run → Kits" and choose the Desktop (default) profile.
    • Choose a version in the "Qt version" dropdown.
    • Ensure that Clang is chosen for your compiler.

Upvotes: 2

Related Questions