QGroundControl build fails with "error: expected type-specifier before ‘QTcpSocket"

Hello all

I am building QGroundControl stable v4.2 from source on Ubuntu 18.04 64bit. I built a minimal Qt5.15.2 from source.

from dir qgroundcontrol/build

$> qmake …
Project MESSAGE: Qt version 5.15.2
Project MESSAGE: Linux build
Project MESSAGE: Daily Build
Project MESSAGE: GIT_DESCRIBE v4.2.3
Project MESSAGE: QGroundControl APP_VERSION_STR VERSION v4.2.3 4.2.3
Project MESSAGE: Release flavor
Project MESSAGE: Skipping support for Pairing
Project MESSAGE: Using MAVLink dialect ‘ardupilotmega’.
Project MESSAGE: Skipping support for Zeroconf (unsupported platform)
Project MESSAGE: Including support for AirMap
Project MESSAGE: Taisync disabled
Project MESSAGE: Microhard disabled
Project MESSAGE: Including support for video streaming
Project MESSAGE: This project is using private headers and will therefore be tied to this specific Qt module build version.
Project MESSAGE: Running this project against other versions of the Qt modules may crash at any arbitrary point.
Project MESSAGE: This is not a bug, but a result of using Qt internals. You have been warned!

$> make -j8
rm -rf /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/build/libs/airmap-platform-sdk && mkdir -p /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/build/libs/airmap-platform-sdk/linux/Qt.5.15 && mkdir -p /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/build/libs/airmap-platform-sdk/include/airmap && mkdir -p /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/build/libs/airmap-platform-sdk/tmp && curl --location --output /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/build/airmap-platform-sdk.deb https://github.com/airmap/platform-sdk/releases/download/2.0/airmap-platform-sdk-2.0.0-Linux.deb && ar p /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/build/airmap-platform-sdk.deb data.tar.gz | tar xvz -C /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/build/libs/airmap-platform-sdk/tmp/ --strip-components=1 && mv -u /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/build/libs/airmap-platform-sdk/tmp/usr/lib/x86_64-linux-gnu/* /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/build/libs/airmap-platform-sdk/linux/Qt.5.15/ && mv -u /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/build/libs/airmap-platform-sdk/tmp/usr/include/airmap/* /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/build/libs/airmap-platform-sdk/include/airmap/ && rm -rf /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/build/libs/airmap-platform-sdk/tmp && rm /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/build/airmap-platform-sdk.deb
compiling /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCMapEngine.cpp
compiling /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCMapTileSet.cpp
compiling /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCMapUrlEngine.cpp
compiling /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCTileCacheWorker.cpp
compiling /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGeoCodeReplyQGC.cpp
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0compiling /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGeoMapReplyQGC.cpp
compiling /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp
0 0 0 0 0 0 0 0 --:–:-- 0:00:01 --:–:-- 0
2 14.6M 2 399k 0 0 80848 0 0:03:09 0:00:05 0:03:04 137kcompiling /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGeoServiceProviderPluginQGC.cpp
13 14.6M 13 1951k 0 0 322k 0 0:00:46 0:00:06 0:00:40 499kcompiling /media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGeoTileFetcherQGC.cpp
/media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCTileCacheWorker.cpp: In member function ‘void QGCCacheWorker::_lookupReady(QHostInfo)’:
/media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCTileCacheWorker.cpp:1187:27: error: expected type-specifier before ‘QTcpSocket’
1187 | auto socket = new QTcpSocket();
| ^~~~~~~~~~
/media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCTileCacheWorker.cpp:1192:26: error: ‘QTcpSocket’ has not been declared
1192 | connect(socket, &QTcpSocket::connected, this, [this, socket] {
| ^~~~~~~~~~
/media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCTileCacheWorker.cpp: In lambda function:
/media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCTileCacheWorker.cpp:1195:13: error: ‘socket’ is not captured
1195 | socket->deleteLater();
| ^~~~~~
/media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCTileCacheWorker.cpp:1192:68: note: the lambda has no capture-default
1192 | connect(socket, &QTcpSocket::connected, this, [this, socket] {
| ^
/media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCTileCacheWorker.cpp:1187:14: note: ‘socket’ declared here
1187 | auto socket = new QTcpSocket();
| ^~~~~~
/media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCTileCacheWorker.cpp: In lambda function:
/media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCTileCacheWorker.cpp:1200:13: error: ‘socket’ is not captured
1200 | socket->deleteLater();
| ^~~~~~
/media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCTileCacheWorker.cpp:1197:77: note: the lambda has no capture-default
1197 | connect(socket, &QAbstractSocket::errorOccurred, this, [this, socket](QAbstractSocket::SocketError error) {
| ^
/media/ashish/Data1/_ASHISH/15_QGroundControl/qgroundcontrol_source_build/qgroundcontrol_stable4p2/qgroundcontrol/src/QtLocationPlugin/QGCTileCacheWorker.cpp:1187:14: note: ‘socket’ declared here
1187 | auto socket = new QTcpSocket();
| ^~~~~~
29 14.6M 29 4447k 0 0 630k 0 0:00:23 0:00:07 0:00:16 906kMakefile:135851: recipe for target ‘QGCTileCacheWorker.o’ failed
make: *** [QGCTileCacheWorker.o] Error 1
make: *** Waiting for unfinished jobs…
100 14.6M 100 14.6M 0 0 1332k 0 0:00:11 0:00:11 --:–:-- 2512k
./usr/
./usr/bin/
./usr/bin/airmap
./usr/include/
./usr/include/airmap/
./usr/include/airmap/advisory.h
./usr/include/airmap/aircraft.h
./usr/include/airmap/aircrafts.h
./usr/include/airmap/airspace.h
./usr/include/airmap/airspaces.h
./usr/include/airmap/authenticator.h
./usr/include/airmap/client.h
./usr/include/airmap/context.h
./usr/include/airmap/credentials.h
./usr/include/airmap/date_time.h
./usr/include/airmap/do_not_copy_or_move.h
./usr/include/airmap/error.h
./usr/include/airmap/evaluation.h
./usr/include/airmap/flight.h
./usr/include/airmap/flight_plan.h
./usr/include/airmap/flight_plans.h
./usr/include/airmap/flights.h
./usr/include/airmap/geometry.h
./usr/include/airmap/logger.h
./usr/include/airmap/monitor/
./usr/include/airmap/monitor/README.md
./usr/include/airmap/monitor/client.h
./usr/include/airmap/optional.h
./usr/include/airmap/outcome.h
./usr/include/airmap/pilot.h
./usr/include/airmap/pilots.h
./usr/include/airmap/qt/
./usr/include/airmap/qt/logger.h
./usr/include/airmap/qt/scheduler.h
./usr/include/airmap/qt/types.h
./usr/include/airmap/rule.h
./usr/include/airmap/ruleset.h
./usr/include/airmap/rulesets.h
./usr/include/airmap/status.h
./usr/include/airmap/telemetry.h
./usr/include/airmap/timestamp.h
./usr/include/airmap/token.h
./usr/include/airmap/traffic.h
./usr/include/airmap/types.h
./usr/include/airmap/version.h
./usr/include/airmap/visibility.h
./usr/lib/
./usr/lib/x86_64-linux-gnu/
./usr/lib/x86_64-linux-gnu/libairmap-cpp.so
./usr/lib/x86_64-linux-gnu/libairmap-cpp.so.2
./usr/lib/x86_64-linux-gnu/libairmap-cpp.so.2.0.0

Any idea what I am missing? I am stuck here