Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling Qt 4.8.3 on Ubuntu 12 failing

Tags:

build

ubuntu

qt

I am new to Ubuntu and i am getting a message while building Qt 4.8.3 on Ubuntu 12:

Basic XLib functionality test failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /home/majidmax/qt-everywhere-opensource-src-4.8.3/mkspecs/linux-g++.

what the proper steps to build Qt on Ubuntu?

like image 926
Majid Max Avatar asked Nov 04 '12 16:11

Majid Max


5 Answers

http://qt-project.org/doc/qt-4.8/requirements-x11.html

the website provide the package list which must be installed

try it~

like image 172
Garlic Tseng Avatar answered Oct 13 '22 22:10

Garlic Tseng


These are the packages you need to install and you'll be good to go. I just had this same problem and this worked for me. These came from the link provided by Garlic Tseng in the accepted answer. I am just putting these here for convenience:

libfontconfig1-dev
libfreetype6-dev
libx11-dev
libxcursor-dev
libxext-dev
libxfixes-dev
libxft-dev
libxi-dev
libxrandr-dev
libxrender-dev

One (copy pastable) command to install all:

sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxcursor-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxrandr-dev libxrender-dev
like image 31
Freedom_Ben Avatar answered Oct 14 '22 00:10

Freedom_Ben


What about sudo apt-get build-dep qt4-qmake?

Try to run that command before you compile Qt (on Debian-like distros).

like image 43
tro Avatar answered Oct 13 '22 23:10

tro


Same problem i faced in fedora20 (64-bit) for Qt-4.8.3

1)- yum install libXext-devel

(internet connectivity should be there for checking the dependency and install all dependency).

2)- ./configure

3)- make

4)- make install

5)- Installation finish successfully.

like image 1
Rahul chand verma Avatar answered Oct 14 '22 00:10

Rahul chand verma


The error message doesn't give a lot of information as to the actual issue of XLib failing.

To get more information on the error causing it to fail you can 'make' the xlib tests:

$ cd <Qt_Source_Directory>/config.tests/x11/xlib/
$ make
g++ -Wl,-O1 -o xlib xlib.o    -L/usr/X11R6/lib -ltcg -lXext -lX11 -lm
/usr/bin/ld: cannot find -ltcg
collect2: error: ld returned 1 exit status
make: *** [xlib] Error 1

In my case above, I was using -ltcg which was being interpreted as an explicit library to include. I was using this option as it is listed on the qt 4.8 configure options as:

Use Link Time Code Generation

When I looked at the configure options using ./configure --help I noticed that this option isn't listed. Removing the option from my configure line fixed my issue.

like image 1
Chris Padgett Avatar answered Oct 13 '22 22:10

Chris Padgett