Question: I am stuck with a problem installing Qt5 on OSX.

The [Qt Requirements for Mac OSX](http://qt-project.org/doc/qt-5.0/qtdoc/requirements-mac.html) 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:

* ["Failed to load platform plugin "xcb" " while launching qt5 app on linux without qt installed](https://stackoverflow.com/questions/17106315/failed-to-load-platform-plugin-xcb-while-launching-qt5-app-on-linux-without)
* [Qt5 installation problems](https://stackoverflow.com/questions/14424158/qt5-installation-problems)

Then [Xquartz](http://xquartz.macosforge.org/landing/) 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.

Answer: 
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.
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.