Qt5 install on OSX -qt-xcb

2019-04-26 16:07发布

I am stuck with a problem installing Qt5 on OSX.

The Qt Requirements for Mac OSX are done - Xcode and command line are installed. Then I followed the steps:

 # mkdir qt5
 # cd qt5
 # git clone git://gitorious.org/qt/qtbase.git
 # cd qt5
 # ./configure
 The test for linking against libxcb and support libraries failed!
 You might need to install dependency packages, or pass -qt-xcb.

Then I also tried

 # cd qtbase
 # ./configure -prefix $HOME/development/macosx/qt5  -nomake docs -nomake examples -nomake demos -nomake tests  -opensource -confirm-license -release -no-c++11
 Unknown part docs passed to -nomake.
 # ./configure
 The test for linking against libxcb and support libraries failed!
 You might need to install dependency packages, or pass -qt-xcb.

Some other links on related problems are:

Then Xquartz was also installed, supposing that the problem is because X11 is missing on OSX Mountain Lion, restarted the computer and tried the installation again. It didn't solved the problem a bit.

On Linux Qt5 installation was nice with no hustle. But on OSX it doesn't work.

I hope someone can give any suggestions.

标签: c++ macos qt x11 xcb
2条回答
The star\"
2楼-- · 2019-04-26 16:08

I just encountered this same problem myself, and I worked around it by specifying the argument -no-xcb (instead of -qt-xcb) to the configure script. That allowed the compilation of the Qt libraries to complete (although some of the Qt example programs failed to compile... but it was enough to get me back on track for now).

I suspect this is a Mavericks-specific problem, as the same Qt source tarball (qt-everywhere-enterprise-5.2.0-src.tar.gz) compiled fine with the normal configure invocation under Mountain Lion.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-04-26 16:13

This is nothing to do with Mavericks. You have MacPorts or something similar in your PATH. The configure script detects X-Windows and therefor tries to configure the xcb backend.

Reset your PATH to a minimal one before compile:

export PATH=/usr/bin:/bin:/usr/sbin:/sbin

That will solve the issue.

查看更多
登录 后发表回答