Compiling Qt 4.8.3 on Ubuntu 12 failing - 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?

http://qt-project.org/doc/qt-4.8/requirements-x11.html
the website provide the package list which must be installed
try it~

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

What about sudo apt-get build-dep qt4-qmake?
Try to run that command before you compile Qt (on Debian-like distros).

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.

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.

what the proper steps to build Qt on Ubuntu?
Check the Qt supported Platforms.
Check Qt for X11 requirements.
3a. Check steps to install Qt on X11 platforms(along with build).
or
3b. Check steps to build static Qt.

Related

Facing "Could not find all of moc, rcc, and uic for Qt5" in omnet++ version 5.7. while installing

I followed every steps of installation manual while installing it. according to the manual, I need to type ./configure. Whenever I typed it, the problem occurred. Showing the exact line"Could not find all of moc, rcc, and uic for Qt5 -- nope, nope, nope"
Before running ./configure you must always source setenv and make sure that all required packages (i.e. qt-default) is installed.
You can try to install Qt5 to solve the problem
sudo apt-get install qt5-default qtcreator

How to manually set GCC as the compiler in QtCreator?

I installed QtCreator on an Odroid but it seems to be missing a compiler. I tried the following terminal commands but it did not solve the problem.
sudo apt-get install g++
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
How can set GCC as the compiler in QtCreator ? Thanks in advance.
Define a compiler in Tools>Options>Build & Run>Compilers, then switch to the kits tab and add that compiler to the kit you want to use.
The process is described in detail in the manual:
https://doc.qt.io/qtcreator/creator-tool-chains.html for the compiler setup and https://doc.qt.io/qtcreator/creator-targets.html is about the kits.

Error cannot find -lsbml and -lstdc++ when compiling qt project

I would like to cross compile a qt project on raspberry. I finished all the installing steps and the configuration of qt creator. But when i tried but when i tried to compile an example project I got an error
cannot find -lsbml
cannot find -lstdc++
First make sure that these libs are already installed:
sudo apt-get install sbml
sudo apt-get install stdc++
I am not sure about the names, but you can check them via apt-cache like:
apt-cache search sbml | less
You can use this to get all packages which are related to the corresponding library. Choose the right package and install it via apt-get install ...
Now try again. When the compile-step still fails you need to specify the lib-directories in the .pro-file like:
LIBS += -L<Path_to_sbml> -lsbml -L<Path_to_stdc++> -lstdc++
Hope that helps you.

Undefined reference to QIconvCodec during Qt embedded make?

I'm trying to configure my Qt for Embedded Linux with a virtual framebuffer according to these instructions. From the Qt for Embedded source folder, I'm trying:
./configure -embedded -opensource -confirm-license -verbose -qvfb
make
I get the following error which prevents me from doing make install:
.obj/release-shared-emb-x86/qtextcodec.o: In function `setup()':
qtextcodec.cpp:(.text+0x23cc): undefined reference to `QIconvCodec::QIconvCodec()'
collect2: ld returned 1 exit status
make[1]: *** [../../lib/libQtCore.so.4.8.4] Error 1
make[1]: Leaving directory `/home/cstjean/qt/src/corelib'
make: *** [sub-corelib-all-ordered] Error 2
If I do:
./configure -embedded -opensource -confirm-license -verbose -qvfb
make -no-iconv
sudo make install -no-iconv
...This works. But when I go into QtCreator, Tools > Options > Build & Run > Qt Versions, I try to select qmake for Qt Embedded (for me it's in /home/cstjean/qt/bin/qmake) and it tells me:
Qt version is not properly installed, please run make install
I've tried googling this like crazy. There are a lot of suggestions to download various libraries, which I've tried to no avail, but perhaps I'm missing something because this is a pretty fresh installation of Ubuntu I'm using.
Thanks.
I solved this problem by installing Gnome and starting over from scratch for my Qt Embedded for Linux installation.
I googled gnome for ubuntu 12.04 and found these instructions. You'll have to see which version of Ubuntu you have and search for that of course. You can see which version you have by typing into a command line:
lsb_release -a
Once I had gnome installed, I restarted my computer and signed in using Gnome.
Then I completely uninstalled and removed all traces of Qt Embedded:
cd yourQtEmbeddedDir
sudo make uninstall
cd ..
rm -r yourQtEmbeddedDir sourceFileTarYouHadDownloaded.tar.gz
I redownloaded the source file tar for Qt Embedded for Linux (from here) and proceeded to install according to these instructions after extracting the source files from the tar:
./configure -embedded -opensource -confirm-license -verbose -qvfb
make
sudo make install
Now, if you tell QtCreator about qmake from this installation, then QtCreator will no longer complain about a bad installation! Ta da!
Note: If you're attempting to the do the Virtual Framebuffer business too, then this is not the end of the road. You need to have Qt for X11 installed as well in order to compile qvfb.
Long story short: You need Gnome if you're trying to install Qt Embedded for Linux with a Virtual Framebuffer on Ubuntu!

/usr/bin/ld: cannot find -lfreetype Why? And how can I make it work?

Exact duplicate:
/usr/bin/ld: cannot find -lfreetype qt
Hi, I'm writing a cross-platform Qt application for a graduate project.
I've been working with Qt 4.3, but just recently upgraded to 4.5.
On my Windows machine, it works great. No problems. However, on my Linux machine, things aren't quite so nice.
I'm using the Qt creator and it goes through the compiling process making all the object files. But then it makes a call to:
g++ -Wl, -rpath, (all the .o files here) -L/media/HOME/Qt-Linux-4.5/qt/lib -lQtGui -L/media/HOME/Qt-Linux-4.5/qt/lib -L/usr/X11R6/lib -pthread -lfreetype -lgobject-2.0 -lrt -lglib-2.0 -ldl -lpthread
It gives me the error:
/usr/bin/ld: cannot find -lfreetype
collect2: ld returned 1 exit status
Now, I can locate libfreetype.so.6 and libfreetype.so.6.3.18 in my /usr/lib folders. I've tried running this inserting -L/usr/lib, but that didn't work. I've tried ln -s /usr/lib/libfreetype.so.6.3.18 libfreetype.so, I've tried editing the ld.so.conf file.
I'm trying this on an eeepc with Eeebuntu, if that helps.
Help!! I've been trying to get this to work for two days. I don't know what else I can do. Any suggestions?
Thanks much!
Brent
You missing dev librart, install libfreetypeX-dev, in debian lenny it would be apt-get install libfreetype6-dev
sudo apt-get install libfreetype6-dev
I've tried ln -s /usr/lib/libfreetype.so.6.3.18 libfreetype.so
Never do things like that unless you want to break your system and learn how to fix it
These I had to install on Kubuntu 9.04 64 bit in order to get a simple test app to build:
sudo apt-get install libfreetype6-dev
sudo apt-get install libavahi-gobject-dev
sudo apt-get install libSM-dev
sudo apt-get install libXrender-dev
sudo apt-get install libfontconfig-dev
sudo apt-get install libXext-dev
Edit: To get OpenGL to build I also had to install libgl1-mesa-dev and freeglut3-dev.
Edit2: Audio required libphonon-dev.
Thanks a lot! Installing the dev libraries got it to work. there were about five more libraries I had to install as well, but once I got them all, everything compiles just fine. Thanks a lot everyone!
When you did your ln -s /usr/lib/libfreetype.so.6.3.18 libfreetype.so, did you make sure that the libfreetype.so symlink ended up in /usr/lib too? To be sure, run ls -l /usr/lib/libfreetype.so and make sure it says what you expect it to.

Resources