QtLocation doesn't compile correctly with qmake -r and make
-
Hello everyone, please can you help me to overcome this big problem.
It's been a long time and I tried to compile the QtLocation module with qt 6.0.3 (Mingw 8.1.0 64 bits), but it's not work.
The process I follow is :
download qtlocation library from GitHub (I tried for 10 last versions).
Run qt 6.0.3 (Mingw 8.1.0 64 bits) cmd.
Go to the qtlocation folder.
Run qmake or run qmake -r
run mingw32-make or run make
run mingw32-make install or run make install/////////////////////////////////////////////////////////////////
C:\Users\Haoudi\Downloads\qtlocation-dev\src\positioning\qgeoareamonitorsource.cpp:41:10: fatal error: QGeoAreaMonitorSource: No such file or directory
#include <QGeoAreaMonitorSource>
^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [Makefile.Release:1793: .obj/release/qgeoareamonitorsource.o] Error 1
make[3]: Leaving directory 'C:/Users/Haoudi/Downloads/qtlocation-dev/qtlocation-shadow-build/src/positioning'
make[2]: *** [Makefile:45: release] Error 2
make[2]: Leaving directory 'C:/Users/Haoudi/Downloads/qtlocation-dev/qtlocation-shadow-build/src/positioning'
make[1]: *** [Makefile:132: sub-positioning-make_first] Error 2
make[1]: Leaving directory 'C:/Users/Haoudi/Downloads/qtlocation-dev/qtlocation-shadow-build/src'
make: *** [Makefile:52: sub-src-make_first] Error 2//////////////////////////////////////////////////////
I follow the same process to compile the MQTT library, and it's work correctly.
-
Hi,
What if you use cmake ?
-
I downloaded qtlocation-5.15 and did a
qmake # from qt5
makeqgeoareamonitorsource.cpp:40:10: fatal error: QGeoAreaMonitorSource: No such file or directory
40 | #include <QGeoAreaMonitorSource>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:1029: .obj/qgeoareamonitorsource.o] Error 1
make[2]: Leaving directory '/home/dev/source/qtlocation-5.15/src/positioning'
make[1]: *** [Makefile:130: sub-positioning-make_first] Error 2
make[1]: Leaving directory '/home/dev/source/qtlocation-5.15/src'
make: *** [Makefile:49: sub-src-make_first] Error 2Any help would be appreciated
-
You look to be using the Ubuntu 22.04 (or equivalent) environment. The qtbase5-dev package does not deploy the private headers that qtlocation requires. You need the qtbase5-private-dev package. With that package present I have no problem building the qtlocation 5.15 branch.
chrisw@newton:~/workspace/qtlocation$ qmake -v QMake version 3.1 Using Qt version 5.15.3 in /usr/lib/x86_64-linux-gnu chrisw@newton:~/workspace/qtlocation$ git branch * 5.15 dev chrisw@newton:~/workspace/qtlocation$ mkdir ../qtlocation_build chrisw@newton:~/workspace/qtlocation$ cd ../qtlocation_build/ chrisw@newton:~/workspace/qtlocation_build$ qmake ../qtlocation/qtlocation.pro Info: creating stash file /home/chrisw/workspace/qtlocation_build/.qmake.stash Info: creating cache file /home/chrisw/workspace/qtlocation_build/.qmake.cache Checking for gypsy... no Checking for winrt... no Running configuration tests... Checking for Gypsy... no Checking for WinRT Geolocation API... no Done running configuration tests. Configure summary: Qt Positioning: Gypsy GPS Daemon ....................... no WinRT Geolocation API .................. no Qt Location: Qt.labs.location experimental QML plugin . no Geoservice plugins: OpenStreetMap ........................ yes HERE ................................. yes Esri ................................. yes Mapbox ............................... yes MapboxGL ............................. yes Itemsoverlay ......................... yes Qt is now configured for building. Just run 'make'. Once everything is built, you must run 'make install'. Qt will be installed into '/usr'. Prior to reconfiguration, make sure you remove any leftovers from the previous build. chrisw@newton:~/workspace/qtlocation_build$ make cd src/ && ( test -e Makefile || /usr/lib/qt5/bin/qmake -o Makefile /home/chrisw/workspace/qtlocation/src/src.pro ) && make -f Makefile ... make[3]: Leaving directory '/home/chrisw/workspace/qtlocation_build/examples/positioning/logfilepositionsource' make[2]: Leaving directory '/home/chrisw/workspace/qtlocation_build/examples/positioning' make[1]: Leaving directory '/home/chrisw/workspace/qtlocation_build/examples' chrisw@newton:~/workspace/qtlocation_build
-
@ChrisW67 Thanks for your reply. I've installed a clean ubuntu 22.04, installed qtbase-dev, qtbase-private-dev and build-essentials. Getting the same result
qmake version 3.1
Using Qt version 5.15.3 in /usr/lib/x86_64-linux-gnu
g++, gcc 11.3.0dev@dev-VirtualBox:~/source/build2$ qmake ../qtlocation-5.15/qtlocation.pro
Running configuration tests...
Done running configuration tests.Configure summary:
Qt Positioning:
Gypsy GPS Daemon ....................... no
WinRT Geolocation API .................. no
Qt Location:
Qt.labs.location experimental QML plugin . no
Geoservice plugins:
OpenStreetMap ........................ yes
HERE ................................. yes
Esri ................................. yes
Mapbox ............................... yes
MapboxGL ............................. yes
Itemsoverlay ......................... yesQt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/usr'.Prior to reconfiguration, make sure you remove any leftovers from
the previous build.dev@dev-VirtualBox:~/source/build2$make
/home/dev/source/qtlocation-5.15/src/positioning/qgeoareamonitorsource.cpp:40:10: fatal error: QGeoAreaMonitorSource: No such file or directory
40 | #include <QGeoAreaMonitorSource>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:837: .obj/qgeoareamonitorsource.o] Error 1
make[2]: Leaving directory '/home/dev/source/build2/src/positioning'
make[1]: *** [Makefile:130: sub-positioning-make_first] Error 2
make[1]: Leaving directory '/home/dev/source/build2/src'
make: *** [Makefile:49: sub-src-make_first] Error 2 -
Where did your qtlocation source code come from? Mine is straight from a git clone.
Are any of the Ubuntu packages:- qtqtlocation5-dev
- libqt5location5-plugin-mapboxgl
- libqt5location-plugins
- libqt5location5
installed? At least one of these interferes with the build for me (but they also install the plugin you are trying to build from source)
-
@ChrisW67
Hi,
It worked this time round.I started on a clean ubuntu 22.04 again.
Installed qtbase-private-dev (which also installes qtbase-dev) , then installed build-essential (previously I installed qtbase-dev before qtbase-private-dev . Can't see how that makes a diff)
after this I could see that qtlocation5-dev , libqt5location5 , libqt5location5-plugin-mapboxgl , libqt5location5-plugins gets installed.
Then:
(This part I also did differently , I previously downloaded a zip from github)
git clone https://github.com/qt/qtlocation.git
cd qtlocation
git checkout 5.15mkdir ../build
cd ../build
qmake ../qtlocation/qtlocation.pro
makeLife can continue now. Thanks for your help!!
-
@PiBo said in QtLocation doesn't compile correctly with qmake -r and make:
@ChrisW67
Hi,
It worked this time round.I started on a clean ubuntu 22.04 again.
Installed qtbase-private-dev (which also installes qtbase-dev) , then installed build-essential (previously I installed qtbase-dev before qtbase-private-dev . Can't see how that makes a diff)
after this I could see that qtlocation5-dev , libqt5location5 , libqt5location5-plugin-mapboxgl , libqt5location5-plugins gets installed.
Then:
(This part I also did differently , I previously downloaded a zip from github)
git clone https://github.com/qt/qtlocation.git
cd qtlocation
git checkout 5.15mkdir ../build
cd ../build
qmake ../qtlocation/qtlocation.pro
makeLife can continue now. Thanks for your help!!
If the package passes qmake, but then fails make, doesn't this indicate there is a problem in the build system not recognizing missing dependencies during at configuration time?