Sunday, November 01, 2015

Installing Qt5.5.1 on Ubuntu 14.04 at VirtualBox

Step 1: Install pre-requisits

Instal pre-requisists following Building Qt From Git article:

sudo apt-get build-dep qt5-default

sudo apt-get install build-essential perl python git


sudo apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev

sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby

sudo apt-get install libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libfontconfig1-dev

sudo apt-get install libcap-dev libbz2-dev libgcrypt11-dev libpci-dev libnss3-dev build-essential libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libdrm-dev libfontconfig1-dev libxtst-dev libasound2-dev gperf libcups2-dev libpulse-dev libudev-dev libssl-dev flex bison ruby

sudo apt-get install libasound2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev

Step 2A: The easy way

Get the latest Qt binaries and run them, e.g.
wget http://qt.mirror.constant.com/archive/qt/5.5/5.5.1/qt-opensource-linux-x64-5.5.1.run
chmod 755 qt-opensource-linux-x64-5.5.1.run
sudo ./qt-opensource-linux-x64-5.5.1.run

Then go to step 4 and skip steps 2B-3B.

Step 2B: Get & Compile Qt from the Sources

The easy way described in Step 2A above is a much better way to go.

Go to the folder where Qt src file resides (e.g. ~/Downloads):

tar -xvf qt-everywhere-opensource-src-5.5.1.tar.gz
sudo mkdir /opt/qt5.5.1
cd qt-everywhere-opensource-src-5.5.1/

 ./configure -prefix /opt/qt5.5.1 -opensource -confirm-license -gstreamer

[it took nearly 6h to complete on my i7+SSD Dell Vostro with 12GB RAM given to Ubuntu VM]

Now we have to let the system know we are willing to use teh new Qt instead of the old default one:
Edit file (reference):

sudo vi /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf

and make it look exactly like this:

/opt/qt5.5.1/bin
/opt/qt5.5.1/lib


(assuming Qt is installed in /opt/qt5.5.1 folder). Check what you got:





qtchooser -print-env

should now print

QT_SELECT="default"
QTTOOLDIR="/opt/qt5.5.1/bin"
QTLIBDIR="/opt/qt5.5.1/lib"

and

qmake -v

should say

QMake version 3.0
Using Qt version 5.5.1 in /opt/qt5.5.1/lib


Step 3B:  Get source & build QtCreator

Now let's build QtCreator from source: first, create a folder for the source code from git, e.g.


mkdir ~/Downloads/qtcreator
cd qtcreator
git clone --recursive git://code.qt.io/qt-creator/qt-creator.git 

Create a new folder for build (MUST be at the same level like qt-creator source code folder):


mkdir qtcreator-build
cd qtcreator-build/
qmake -r ../qt-creator/qtcreator.pro
make
sudo make install

Step 4: Get QtCreator work

On a run attempt QtCreator fails:

qtcreator
libGL error: pci id for fd 22: 80ee:beef, driver (null)
OpenGL Warning: glFlushVertexArrayRangeNV not found in mesa table
OpenGL Warning: glVertexArrayRangeNV not found in mesa table
OpenGL Warning: glCombinerInputNV not found in mesa table
OpenGL Warning: glCombinerOutputNV not found in mesa table
OpenGL Warning: glCombinerParameterfNV not found in mesa table
OpenGL Warning: glCombinerParameterfvNV not found in mesa table
OpenGL Warning: glCombinerParameteriNV not found in mesa table
OpenGL Warning: glCombinerParameterivNV not found in mesa table
OpenGL Warning: glFinalCombinerInputNV not found in mesa table
OpenGL Warning: glGetCombinerInputParameterfvNV not found in mesa table
OpenGL Warning: glGetCombinerInputParameterivNV not found in mesa table
OpenGL Warning: glGetCombinerOutputParameterfvNV not found in mesa table
OpenGL Warning: glGetCombinerOutputParameterivNV not found in mesa table
OpenGL Warning: glGetFinalCombinerInputParameterfvNV not found in mesa table
OpenGL Warning: glGetFinalCombinerInputParameterivNV not found in mesa table
OpenGL Warning: glDeleteFencesNV not found in mesa table
OpenGL Warning: glFinishFenceNV not found in mesa table
OpenGL Warning: glGenFencesNV not found in mesa table
OpenGL Warning: glGetFenceivNV not found in mesa table
OpenGL Warning: glIsFenceNV not found in mesa table
OpenGL Warning: glSetFenceNV not found in mesa table
OpenGL Warning: glTestFenceNV not found in mesa table
libGL error: core dri or dri2 extension not found
libGL error: failed to load driver: vboxvideo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00000000029efa10
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00000000029efa10
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00000000029efa10, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00000000029efa10
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00000000029efa10, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00000000029efa10
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00000000029efa10, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00000000029efa10
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00000000029efa10, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00000000029efa10
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00000000029efa10, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00000000029efa10
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00000000029efa10, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00000000029efa10
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00000000029efa10, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00000000029efa10
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: glXGetFBConfigAttrib for 00000000029efa10, failed to get XVisualInfo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00000000029efa10
OpenGL Warning: Retry with 0x8002 returned 0 visuals
Could not initialize GLX
Aborted (core dumped)


The only solution I found was shutting down  my VirtualBox VM, go to Settings->Display and switch OFF 3-D acceleration like suggsted here.

I still got some run-time errors:

libGL error: pci id for fd 22: 80ee:beef, driver (null)
libGL error: core dri or dri2 extension not found
libGL error: failed to load driver: vboxvideo


but now QtCreator window opened.


No comments: