Get Qt5 and run on the new Mac

From Ubuntu, I bought a new iMac and tried to set up my Qt development. Everything else is already working. Xcode command line tools are also installed.

Because it surprised me how good brew and brew cask , I wanted to install Qt5 with them. On the one hand, it is very fast, and I do not need to go to any home page to download it. On the other hand, I do not need to worry about the installation directory. However, having multiple versions should also be much simpler.

I used the following commands:

brew install qt5

brew cask install qt-creator

Qt5 now installed under /usr/local/Cellar/qt5/5.4.1 . I also added the bin folder to my path (made in .bash_profile ). QtCreator, Linguist and all other applications are shown on my launcher. But, unfortunately, this has not yet been done.

QtCreator says no version of Qt is known. I tried adding qmake, but I was unable to navigate to the above folder.

Can someone give me a hint on how to fix this problem? Installing qt through the installer should be the last option.

+6
source share
2 answers

I had a similar problem with Qt Creator, now in Mac GUI applications there is no access to environment variables (in previous versions it was different).

You need to manually configure the qmake path in Qt Creator using Command-Shift-G in Finder to navigate to the folder you need.

+4
source

Another option is to use brew link qt5 --force , which symbolizes the various brew link qt5 --force binaries and libraries in your /usr/local/bin and /usr/local/lib directories. This will give you qmake on the command line without the need to add anything special to your .bash_profile path. The main reason this is not done by default is that Qt4 also somewhat popular.

This may become a bit messy, but if you need to install Qt4 , you can disable Qt5 at any time by running brew unlink qt5 and it will keep the installation intact. Then do brew install qt to get Qt4 , which, unlike installing brew for Qt5 , will actually create links directly in /usr/local without having to manually make brew link qt . You can disconnect Qt4 and reconnect Qt5 (or vice versa) when you need to switch.

+4
source

Source: https://habr.com/ru/post/984650/


All Articles