Unsolved Cross-Build QT 5.13.2 on Win32/MSVC for Linux/ARM: Headers with relative path not found
-
Hello,
I'm trying to build Qt 5.13.2 on Windows for our IMX6 board, but the build is failing to find header files which are referenced by relative paths.
Here the full output of the error:
cd fontdatabases\ && ( if not exist Makefile C:\Users\HannesM\Documents\Work\qt-everywhere-src-5.13.2\qt-everywhere-src-5.13.2\qtbase\bin\qmake.exe -o Makefile C:\Users\HannesM\Documents\Work\qt-everywhere-src-5.13.2\qt-everywhere-src-5.13.2\qtbase\src\platformsupport\fontdatabases\fontdatabases.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\HostX86\x86\nmake.exe" -f Makefile Microsoft (R) Program Maintenance Utility Version 14.23.28106.4 Copyright (C) Microsoft Corporation. All rights reserved. arm-linux-gnueabihf-g++ -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=hard --sysroot=C:/Qt/5.13.2/varsomimx6/cortexa9hf-neon-poky-linux-gnueabi -g -fPIC -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -Wdate-time -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -Wno-error=strict-overflow -D_REENTRANT -DQT_NO_CAST_FROM_ASCII -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_FONTDATABASE_SUPPORT_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_GUI_LIB -DQT_CORE_LIB -I. -I..\..\..\include -I..\..\..\include\QtFontDatabaseSupport -I..\..\..\include\QtFontDatabaseSupport\5.13.2 -I..\..\..\include\QtFontDatabaseSupport\5.13.2\QtFontDatabaseSupport -I..\..\..\include\QtGui\5.13.2 -I..\..\..\include\QtGui\5.13.2\QtGui -I..\..\..\include\QtCore\5.13.2 -I..\..\..\include\QtCore\5.13.2\QtCore -I..\..\..\include\QtGui -I..\..\..\include\QtCore -I.moc -isystem C:\Qt\5.13.2\varsomimx6\cortexa9hf-neon-poky-linux-gnueabi\usr\include\freetype2 -isystem C:\Qt\5.13.2\varsomimx6\cortexa9hf-neon-poky-linux-gnueabi\usr\include\freetype2 -I..\..\..\mkspecs\devices\linux-imx6-g++ -x c++-header -c ..\..\corelib\global\qt_pch.h -o .pch\Qt5FontDatabaseSupport.gch\c++ arm-linux-gnueabihf-g++ -c -include .pch\Qt5FontDatabaseSupport -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=hard --sysroot=C:/Qt/5.13.2/varsomimx6/cortexa9hf-neon-poky-linux-gnueabi -g -fPIC -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -Wdate-time -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -Wno-error=strict-overflow -D_REENTRANT -DQT_NO_CAST_FROM_ASCII -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_FONTDATABASE_SUPPORT_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_GUI_LIB -DQT_CORE_LIB -I. -I..\..\..\include -I..\..\..\include\QtFontDatabaseSupport -I..\..\..\include\QtFontDatabaseSupport\5.13.2 -I..\..\..\include\QtFontDatabaseSupport\5.13.2\QtFontDatabaseSupport -I..\..\..\include\QtGui\5.13.2 -I..\..\..\include\QtGui\5.13.2\QtGui -I..\..\..\include\QtCore\5.13.2 -I..\..\..\include\QtCore\5.13.2\QtCore -I..\..\..\include\QtGui -I..\..\..\include\QtCore -I.moc -isystem C:\Qt\5.13.2\varsomimx6\cortexa9hf-neon-poky-linux-gnueabi\usr\include\freetype2 -isystem C:\Qt\5.13.2\varsomimx6\cortexa9hf-neon-poky-linux-gnueabi\usr\include\freetype2 -I..\..\..\mkspecs\devices\linux-imx6-g++ -o .obj\qfreetypefontdatabase.obj freetype\qfreetypefontdatabase.cpp In file included from freetype\qfreetypefontdatabase.cpp:51:0: ..\..\..\include\QtFontDatabaseSupport\5.13.2/QtFontDatabaseSupport/private/qfontengine_ft_p.h:1:88: fatal error: ../../../../../src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h: No such file or directory compilation terminated. NMAKE : fatal error U1077: 'C:\Qt\5.13.2\gcc-linaro\bin\arm-linux-gnueabihf-g++.EXE' : return code '0x1' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.
The missing file is clearly there. It can be found on the disc. The relative path seems also correct:
C:\Users\HannesM\Documents\Work\qt-everywhere-src-5.13.2\qt-everywhere-src-5.13.2\qtbase\include\QtFontDatabaseSupport\5.13.2\QtFontDatabaseSupport\private>type qfontengine_ft_p.h #include "../../../../../src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h" C:\Users\HannesM\Documents\Work\qt-everywhere-src-5.13.2\qt-everywhere-src-5.13.2\qtbase\include\QtFontDatabaseSupport\5.13.2\QtFontDatabaseSupport\private>type ..\..\..\..\..\src\platformsupport\fontdatabases\freetype\qfontengine_ft_p.h /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. [snip]
Compiler header search paths (ran in the fontdatabases directory where the Makefile is located):
arm-linux-gnueabihf-g++ -c -include .pch\Qt5FontDatabaseSupport -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=hard --sysroot=C:/Qt/5.13.2/varsomimx6/cortexa9hf-neon-poky-linux-gnueabi -g -fPIC -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -Wdate-time -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -Wno-error=strict-overflow -D_REENTRANT -DQT_NO_CAST_FROM_ASCII -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_FONTDATABASE_SUPPORT_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_GUI_LIB -DQT_CORE_LIB -I. -I..\..\..\include -I..\..\..\include\QtFontDatabaseSupport -I..\..\..\include\QtFontDatabaseSupport\5.13.2 -I..\..\..\include\QtFontDatabaseSupport\5.13.2\QtFontDatabaseSupport -I..\..\..\include\QtGui\5.13.2 -I..\..\..\include\QtGui\5.13.2\QtGui -I..\..\..\include\QtCore\5.13.2 -I..\..\..\include\QtCore\5.13.2\QtCore -I..\..\..\include\QtGui -I..\..\..\include\QtCore -I.moc -isystem C:\Qt\5.13.2\varsomimx6\cortexa9hf-neon-poky-linux-gnueabi\usr\include\freetype2 -isystem C:\Qt\5.13.2\varsomimx6\cortexa9hf-neon-poky-linux-gnueabi\usr\include\freetype2 -I..\..\..\mkspecs\devices\linux-imx6-g++ -E -Wp,-v - #include "..." search starts here: #include <...> search starts here: . ..\..\..\include ..\..\..\include\QtFontDatabaseSupport ..\..\..\include\QtFontDatabaseSupport\5.13.2 ..\..\..\include\QtFontDatabaseSupport\5.13.2\QtFontDatabaseSupport ..\..\..\include\QtGui\5.13.2 ..\..\..\include\QtGui\5.13.2\QtGui ..\..\..\include\QtCore\5.13.2 ..\..\..\include\QtCore\5.13.2\QtCore ..\..\..\include\QtGui ..\..\..\include\QtCore .moc ..\..\..\mkspecs\devices\linux-imx6-g++ C:\Qt\5.13.2\varsomimx6\cortexa9hf-neon-poky-linux-gnueabi\usr\include\freetype2 c:\qt\5.13.2\gcc-linaro\bin\../lib/gcc/arm-linux-gnueabihf/5.3.1/include c:\qt\5.13.2\gcc-linaro\bin\../lib/gcc/arm-linux-gnueabihf/5.3.1/include-fixed c:\qt\5.13.2\gcc-linaro\bin\../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include C:/Qt/5.13.2/varsomimx6/cortexa9hf-neon-poky-linux-gnueabi/usr/include End of search list. #
Build setup:
- Host compiler: Visual Studio 2019
- Cross compiler: Linaro arm-linux-gnueabihf-g++ (gcc version 5.3.1). I have already a working setup with Qt 5.9.2 which allows to build linux binaries with Qt Creator on Windows and this is using the same cross-compiler.
- Build environment: Developer Command Prompt for VS2019
- perl 5.30.1
- python 3.7.6
Configuration line:
configure.bat -platform win32-msvc -device linux-imx6-g++ -device-option CROSS_COMPILE=arm-linux-gnueabihf- -sysroot C:/Qt/5.13.2/varsomimx6/cortexa9hf-neon-poky-linux-gnueabi -prefix /usr -extprefix c:/Qt/5.13.2/qt-build-install -v -developer-build -opensource -confirm-license -debug -qml-debug -sql-sqlite -syslog -nomake examples -nomake tests
What seems strange is that when restarting a fresh build from scratch the build fails at different places. I tried it three times, one time failing at finding a header in plugins\platforms\eglfs\deviceintegration\eglfs_emu, the second time it completed to build QtCore but failed in qtquickcontrols2 and now in fontdatabases\freetype. Parallel build would explain this behaviour, but AFAIK nmake does not do parallel builds.
Initially I've tried a shadow build in a separate directory. But building in the source directory fails also.
I've also tried with Mingw and MSYS2 as some articles suggest, but wasn't able to compile qmake due missing win32 header files of the mingw compiler.Has someone encountered similar issues or has some ideas/suggestions to tackle the problem?
Could this be a problem of mixing the include path up with slashes and backslashes on Windows?Thanks,
Hannes