I try to compile Qt from sources, everything goes ok(more or less), except dbus part.
./configure -v -opensource -dbus-linked -arch i386
Configure shows this error:
1 error generated.
make: * [dbus.o] Error 1
D-Bus disabled.
The QtDBus module cannot be enabled because libdbus-1 version 0.93 was not found.
Turn on verbose messaging (-v) to ./configure to see the final report.
If you believe this message is in error you may use the continue
switch (-continue) to ./configure to continue.
I installed dbus 1.6 with Homebrew, but configure tool can't see it. Lib and headers are located in /usr/local/Cellar/d-bus/1.6.18. How to point configure to this location?
Platform is OS X.
Well the problem seems to be that, its not finding the dbus libraries.
Set the path of the library and the includes when you configure, something like this, assuming your dbus libraries and includes are in
/usr/local/Cellar/d-bus/1.6.18
./configure -v -opensource -arch i386 -dbus-linked -L/usr/local/Cellar/d-bus/1.6.18/lib -I/usr/local/Cellar/d-bus/1.6.18/include
where -I will tell qmake to include headers from that path and -L to link to the dbus libraries.
Related
I have a system running redhat 7.9 which I am not allowed to do system changes to. The system does not have openssl installed.
I am trying to configure QT with:
./configure -release -no-ssl -no-openssl
This gives me this error message which I cant seem to resolve:
+ mkdir -p qtbase
+ cd qtbase
+ exec /home/osfas/osmiv/projects/qt/qt-everywhere-src-6.4.2/qtbase/configure -top-level -release -no-ssl -no-openssl
cmake: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
I am trying to understand how the configuration work but I am struggling.
It took me a while to figure out that the error. ldd cmake revailed a dependency til libssl1.so.1.1
So the error has nothing to do with QT configure
I trying to compile a native build of Qt 5.7 (I've yet to do a cross-compilation of that thing...) on the Raspberry Pi 2. I have followed the tutorial on the official Qt wiki. The configure step I have is:
./configure -v -opengl es2 -tslib -force-pkg-config -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/usr/bin/ \
-opensource -confirm-license -optimized-qmake -reduce-exports -release -qt-pcre -make libs \
-prefix /usr/local/qt5 2>&1 | tee config.out
And my setup is similar to the one in the tutorial - I'm using an external USB stick with ext4 file system mounted at /media/USB and that a mount --bind from /media/USB/build/QT_SRC to /opt/QT_SRC. Prerequirements have been installed (including the libxcb-xinerama0 and libxcb-xinerama0-dev which the article points out as necessary for Qt5.6 and later). A !1GB swapfile was added to USB drive too.
After I executed ./configure I did
time make -j3 2>&1 | tee make.out
I've also tried plain make (without support of parallel compilation and linking). The result is the same:
/opt/QT_SRC/qtbase/bin/qmake -qtconf /opt/QT_SRC/qtbase/bin/qt.conf -o Makefile qt.pro
/opt/QT_SRC/qtbase/bin/qmake -qtconf /opt/QT_SRC/qtbase/bin/qt.conf -o Makefile qt.pro
/opt/QT_SRC/qtbase/bin/qmake -qtconf /opt/QT_SRC/qtbase/bin/qt.conf -o Makefile qt.pro
/opt/QT_SRC/qtbase/bin/qmake -qtconf /opt/QT_SRC/qtbase/bin/qt.conf -o Makefile qt.pro
/opt/QT_SRC/qtbase/bin/qmake -qtconf /opt/QT_SRC/qtbase/bin/qt.conf -o Makefile qt.pro
/opt/QT_SRC/qtbase/bin/qmake -qtconf /opt/QT_SRC/qtbase/bin/qt.conf -o Makefile qt.pro
...
...
...
/opt/QT_SRC/qtbase/bin/qmake -qtconf /opt/QT_SRC/qtbase/bin/qt.conf -o Makefile qt.pro
This is all that I'm getting. It repeats and repeats itself A LOT OF TIMES and for a LONG PERIOD OF TIME. I wanted to do part of the build while I was sleeping so I just ran make before I went to bed...6.5 hours ago. Now that I'm awake I found this...result. I obviously have the qmake in there otherwise an error would have been triggered but I have no idea what is happening here.
Has anyone tried to build Qt 5.7 on Raspberry Pi 2 and encountered this weird issue?
For some reason the top level configure is not working properly (at least in my case...). I had to go inside qtbase and run it from there. You can follow most of the instructions from the official guide on building Qt 5 natively on the Pi but it appears that not everything will be compiled and installed. The solution of this problem came from this post where it says:
cd to the top level directory of the Qt 5's sources
$ cd QT_SRC_ROOT_DIRECTORY
Choose which modules you would like to build and install and do
$ for module in qtcharts qtdatavis3d qtimageformats qtsvg ...;
> do
> cd QT_SRC_ROOT_DIRECTORY/$module
> QT_SRC_ROOT_DIRECTORY/qtbase/bin/qmake
> make
> sudo make install
> done
This basically loops through each module by going inside, running qmake (that is why you first have to compile what's inside qtbase so that you can have the qmake binary - except for the qtbase all other modules are based on pro files that is Qt project files which can be used only with a qmake tool), then make and finally sudo make install.
I used absolute paths (unlike in the mentioned blog post) since the ../$module inside the for loop didn't actually work but using absolute paths worked like a charm. So in my case I had /opt/QT_SRC as my QT_SRC_ROOT_DIRECTORY so I added it in that loop for accessing each $module. The qmake in my case was at /opt/QT_SRC/qtbase/bin/qmake.
Hope this helps someone else. I now have fully functional Qt 5.7 on my Raspberry Pi 2 including the GPL modules QtCharts and QtDataVisualization. Just tested the touch examples as well as the OpenGL Qt cube example - wonderful!
PS: The documenation on both native and cross-compile builds for the Pi needs serious updates and fixing...And research how to do things properly.
I ran into the same problem building Qt 5.7 on Raspberry Pi 3. I solved it by building and installing all modules individually, starting with qtbase like this:
$ .../qtbase/bin/qmake
$ make
$ make install
The order of building is important. I can't remember the order I followed but, some of the Qt modules yield an error if they need another module built first. Error messages are like this:
Some of the required modules (qtHaveModule(???)) are not available
I didn't build a few modules like qtwayland, qtwebview or qtwebengine because they need some other stuff installed and I don't need them.
After building Qt 5.7 and configuring my Raspberry Pi, I can run all my Qt applications successfully.
My machine use Ubuntu OS.
I built Qt 5.5.1 manually against static linking. Configuring the built, specified a path to install to:
$ ./configure -static -prefix /home/myname/qt_src/installed/
Then I moved the built stuff to another Ubuntu machine and tried call qmake from a shell:
$ qmake CONFIG+=release CONFIG-=debug /home/othername/project/q_panorama.pro -r -spec linux-g++
But I stucked with error
Could not find qmake configuration file linux-g++
Trying to fix it, I discovered that qmake's QTDIR (is it?) is incorrect:
$ qmake -v
QMake version 3.0
Using Qt version 5.5.1 in /home/myname/qt_src/installed/
Okay. Try to change special var with qmake -set option (here consider only one of vars - QT_INSTALL_PREFIX, - for simplicity). First, check it's consistency:
$ qmake -query QT_INSTALL_PREFIX
/home/myname/qt_src/installed/
Perform:
$ qmake -set QT_INSTALL_PREFIX "/home/othername/qt_static/"
Check again:
$ qmake -query QT_INSTALL_PREFIX
/home/myname/qt_src/installed/
Why the variable does not modify?
How can I make Manually Built static version of Qt work? Please, help.
Did not find the way to resolve the issue, and thus decided to act with brute force:
Created a user othername in my machine;
Run full build cycle for the path desired (under the user created).
Copied the built stuff to the target machine
PROFIT.
I am trying to build Qt 5 on a Nitrogen6x board powered by an *i.MX6Q`.
I've installed Debian/wheezy on the board and am using an Ubuntu 12.10 machine for cross-compiling.
Configuring Qt works like a charm but I am stuck in the make step.
This is the configure script I run:
./configure -v -opensource -confirm-license -reduce-relocations -no-pch -no-xcb -no-opengl -opengl es2 -qt-libpng -qt-zlib -qt-xkbcommon -qt-xcb -qt-pcre -qt-libjpeg -qt-sql-mysql -optimized-qmake\
-make libs -device imx6 \
-compile-examples \
-device-option CROSS_COMPILE=/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabi- \
-sysroot /media/finn/d72e3b65-b529-4e5c-9d30-872e1b0c9973 \
-prefix /opt/qt5
And this is the error I receive about 5 minutes into the make process:
/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld:
/media/finn/d72e3b65-b529-4e5c-9d30-872e1b0c9973/usr/lib/libm.a(mpa.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/media/finn/d72e3b65-b529-4e5c-9d30-872e1b0c9973/usr/lib/libm.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
I've run into the same error before, when it was trying to access libz.a but adding the qt-zlib parameter to the configure command fixed that issue.
Many articles state that affected applications/libraries should be recompiled, however I don't think that's possible as libm is part of libc6.
I already tried reinstalling it using aptitude remove libc6-dev zlib1g-dev g++-4.6
and apt-get install gcc g++ make flex bison openssl libssl-dev perl perl-base perl-modules libperl-dev build-essential
Sadly this did not fix the problem.
Debian has been installed using the official network installer as well as a Kernel and an Overlay provided by Boundarydevices, the manufacturer of the board.
Does anyone has an idea how to fix this?
My next step would be to install a completely new Debian system but I would really like to avoid that.
Edit
Compiling qtbase with -static option works for me, however I am running into this error when trying to build qtdeclarative during the make step:
/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
/home/finn/qt/qtbase/lib/libQt5Core.a(qlibrary_unix.o): In function `QLibraryPrivate::load_sys()':
qlibrary_unix.cpp:(.text+0xaac): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lqxcb
/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/arm-linux-gnueabihf/libpthread.so.0
/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find /usr/lib/arm-linux-gnueabihf/libpthread_nonshared.a
collect2: error: ld returned 1 exit status
Edit 2 - Solution
I fixed the problem and successfully compiled Qt.
All I needed to do was reinstall Ubuntu. It sure isn't an elegant solution but it works for me.
A litte late, but I found the problem/solution:
The problem is the sysroot. Normally gcc links to shared libraries. But when it cant find it, gcc uses the static libraries (.a). When you look in [sysroot]/usr/lib/arm-linux-gnueabihf the shared libraries are not in this place. There are only symlinks to /lib/arm-linux-gnueabihf. So gcc looks for the shared libraries on you host-pc, where it can not find them.
Solution
Create just the right symlink. (Here's an example for libglib, the X is the version number)
ln -s [sysroot]/lib/arm-linux-gnueabihf/libglib.so.X \
[sysroot]/usr/lib/arm-linux-gnueabihf/libglib.so
(Dont forget to remove the old symlink and create it after compiling successfully; i just do the following before compiling:
mv file.so file.so.backup
another solution
Another solution is to change the absolut symlinks to relative ones.
For Example, if your library is /lib/arm-linux-gnueabihf/libglib.so.X and you need a link in /usr/lib/arm-linux-gnueabihf/, you just do:
ln -s ../../../lib/arm-linux-gnueabihf/libglib.so.X \
[sysroot]/usr/lib/arm-linux-gnueabihf/libglib.so
libm.a(mpa.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object
Translation: you are trying to link non--fPIC compiled object file (mpa.o from libm.a) into a shared library. You can't do that.
You need to either find/install libm.so for your target, or configure qt5 to not build shared library (possibly with --disable-shared option).
How to change compiler (GCC) in Qt? I've installed GCC 4.4 and 4.6. At the momment Qt uses 4.4 but I'd like it to use 4.6. How to do it?
In the build sequence it may have a qmake command like qmake YourProject.pro -r -spec linux-g++-64 the choice of the tool chain is done in the spec file here linux-g++-64. Your will find this file in path-to-the-sdk/qt/mkspecs/linux-g++-64 (you get the concept right?)... If you open the spec file you will see that it includes the linux spec and the g++ spec.
One solution is to copy the g++ spec file and rename it g++-4.6 for example edit it and change :
QMAKE_CC = gcc
QMAKE_CXX = g++
to :
QMAKE_CC = gcc-4.6
QMAKE_CXX = g++-4.6
Idem for the linux-g++-64 it can be copied to linux-g++-4.6-64 and modify the include(...) command to include your new g++-4.6 file.
Finally build your project with qmake YourProject.pro -r -spec linux-g++-4.6-64.
I hope it's clear :) ...
I realise I am very late for the party but on Linux it is as simple as follows:
qmake -makefile <your-project.pro> -spec linux-clang
On my system, all sorts of different mkspecs are available at:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs
Running make CC=my-custom-gcc CXX=my-custom-g++ LINK=my-custom-g++ seems to do the trick for me. But it might not be 100% safe (i.e. I wouldn't be surprised if running qmake with Linux specs and then specifying mingw32 compilers would fail).
If you are using Qt Creator 2.2.0, you can try Tools > Options > Tool Chains and then Add > MinGW.