Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt5 install on OSX -qt-xcb

Tags:

c++

macos

x11

qt

xcb

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:

  • "Failed to load platform plugin "xcb" " while launching qt5 app on linux without qt installed

  • Qt5 installation problems

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.

like image 242
ThreaderSlash Avatar asked Dec 16 '13 05:12

ThreaderSlash


People also ask

How do I install Qt on macOS?

Instead, macOS uses its own native windowing system that is accessible through the Cocoa API. To download and install Qt for macOS, follow the instructions on the Getting Started with Qt page.

How does QQT 5 work in the macOS App Store?

Qt 5 aims to stay within the app store sandbox rules. macdeployqt (bin/macdeployqt) can be used as a starting point for app store deployment. Note: For selling applications in the macOS App Store, special rules apply. In order to pass validation, the application must verify the existence of a valid receipt before executing any code.

How do I build Qt on x86_64h?

By default, Qt is built for x86_64. To build for x86_64h (Haswell). use the QMAKE_APPLE_DEVICE_ARCHS qmake variable. This is selectable at configure time:

How do I run qmake at the command line?

Another option is to use brew link qt5 --force, which will symlink the various Qt5 binaries and libraries into your /usr/local/bin and /usr/local/lib directories. This will give you qmake at the command line, without requiring you to add anything special to your path in .bash_profile.


2 Answers

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.

like image 78
Jeremy Friesner Avatar answered Oct 13 '22 14:10

Jeremy Friesner


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.

like image 28
Sandy Avatar answered Oct 13 '22 15:10

Sandy