Unsolved Build error compiling printsupport plugin with Qt5.8 and 5.9 and nmake
-
I'm attempting to build Qt from source using the Visual Studio 2017 x86 toolchain (msvc-141). I've tried building Qt5.8 and 5.9 from both the github repo and from the qt-everywhere-opensource-src-5.9.1.zip download and each time it fails with an error here:
Microsoft (R) Program Maintenance Utility Version 14.11.25508.2
Copyright (C) Microsoft Corporation. All rights reserved."f:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX86\x86\nmake.exe" -f Makefile.Debug all
Microsoft (R) Program Maintenance Utility Version 14.11.25508.2
Copyright (C) Microsoft Corporation. All rights reserved.generating .moc/debug/moc_predefs.h
moc F:\Dev\qt5\qtbase\src\plugins\printsupport\windows\main.cpp
F:\Dev\qt5\qtbase\src\plugins\printsupport\windows\main.cpp(51): Parse error at "IID"
NMAKE : fatal error U1077: 'echo' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"f:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX86\x86\nmake.exe"' : 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.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.I don't need printing support so is it possible to remove this plugin path altogether?
I have added all the disable print options I can find to my configure command line.
..\configure -prefix ./vc-141-x86 -debug-and-release -opensource -confirm-license -platform win32-msvc -static -no-static-runtime -mp -dbus-runtime -no-harfbuzz -no-egl -no-eglfs -no-freetype -no-gif -no-glib -no-gstreamer -no-icu -no-kms -no-libudev -no-mtdev -no-reduce-relocations -no-qml-debug -no-sql-db2 -no-sql-ibase -no-sql-oci -no-sql-tds -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-use-gold-linker -nomake examples -nomake tests -ssl -openssl-linked -opengl desktop -optimized-qmake -pch -qt-libpng -qt-libjpeg -qt-pcre -qt-zlib -silent -verbose -no-feature-printer -no-feature-printdialog -I "f:/deps/openssl/1.0.2/vc141-x86/include" -L "f:/deps/openssl/1.0.2/vc141-x86/lib" -skip qt3d -skip qtdoc -skip qtwayland -skip qtwebview -skip qtwebengine -skip qtwebchannel -skip qtscript -recheck-all
-
Hi,
You should be able to disable print support however you have to take a look at the configure options for that, I don't remember exactly what it is on Windows. i.e. for Linux/macOS it's
-no-cups
. -
I've trawled through the config options a few times and I couldn't find a Windows equivalent for no-cups.
My config.summary does have it as disabled.
Build type: win32-msvc (i386, CPU features: sse sse2)
Configuration: sse2 sse3 ssse3 sse4_1 sse4_2 avx avx2 compile_examples f16c largefile msvc_mp precompile_header silent debug_and_release release debug build_all c++11 concurrent dbus no-pkg-config no-qml-debug release_tools static stl
Build options:
Mode ................................... debug and release; default link: debug; optimized tools
Optimize release build for size ........ no
Building shared libraries .............. no
Using C++ standard ..................... C++11
Using gold linker ...................... no
Using precompiled headers .............. yes
Using LTCG ............................. no
Target compiler supports:
SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
AVX .................................. AVX AVX2 F16C
AVX512 ............................... <none>
Build parts ............................ libs tools
App store compliance ................... no
Qt modules and options:
Qt Concurrent .......................... yes
Qt D-Bus ............................... yes
Qt D-Bus directly linked to libdbus .... no
Qt Gui ................................. yes
Qt Network ............................. yes
Qt Sql ................................. yes
Qt Testlib ............................. yes
Qt Widgets ............................. yes
Qt Xml ................................. yes
Support enabled for:
Using pkg-config ....................... no
QML debugging .......................... no
udev ................................... no
Using system zlib ...................... no
Qt Core:
DoubleConversion ....................... yes
Using system DoubleConversion ........ no
GLib ................................... no
iconv .................................. no
ICU .................................... no
Logging backends:
journald ............................. no
syslog ............................... no
slog2 ................................ no
Using system PCRE2 ..................... no
Qt Network:
getaddrinfo() .......................... no
getifaddrs() ........................... no
IPv6 ifname ............................ no
libproxy ............................... no
OpenSSL ................................ yes
Qt directly linked to OpenSSL ........ yes
SCTP ................................... no
Use system proxies ..................... yes
Qt Gui:
Accessibility .......................... yes
FreeType ............................... no
Using system FreeType ................ no
HarfBuzz ............................... no
Using system HarfBuzz ................ no
Fontconfig ............................. no
Image formats:
GIF .................................. no
ICO .................................. yes
JPEG ................................. yes
Using system libjpeg ............... no
PNG .................................. yes
Using system libpng ................ no
EGL .................................... no
OpenVG ................................. no
OpenGL:
ANGLE ................................ no
Desktop OpenGL ....................... yes
Dynamic OpenGL ....................... no
OpenGL ES 2.0 ........................ no
OpenGL ES 3.0 ........................ no
OpenGL ES 3.1 ........................ no
Session Management ..................... yes
Features used by QPA backends:
evdev .................................. no
libinput ............................... no
INTEGRITY HID .......................... no
mtdev .................................. no
tslib .................................. no
xkbcommon-evdev ........................ no
QPA backends:
DirectFB ............................... no
EGLFS .................................. no
LinuxFB ................................ no
VNC .................................... no
Mir client ............................. no
Windows:
Direct 2D ............................ yes
DirectWrite .......................... yes
DirectWrite 2 ........................ yes
Qt Widgets:
GTK+ ................................... no
Styles ................................. Fusion Windows WindowsXP WindowsVista
Qt PrintSupport:
CUPS ................................... no
Qt Sql:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. no
OCI (Oracle) ........................... no
ODBC ................................... no
PostgreSQL ............................. no
SQLite2 ................................ no
SQLite ................................. no
Using system provided SQLite ......... no
TDS (Sybase) ........................... no
Qt SerialBus:
Socket CAN ............................. no
Socket CAN FD .......................... no
QtXmlPatterns:
XML schema support ..................... yes
Qt QML:
QML interpreter ........................ yes
QML network support .................... yes
Qt Quick:
Direct3D 12 ............................ yes
AnimatedImage item ..................... yes
Canvas item ............................ yes
Support for Qt Quick Designer .......... yes
Flipable item .......................... yes
GridView item .......................... yes
ListView item .......................... yes
Path support ........................... yes
PathView item .......................... yes
Positioner items ....................... yes
ShaderEffect item ...................... yes
Sprite item ............................ yes
Qt Gamepad:
SDL2 ................................... no
Qt Bluetooth:
BlueZ .................................. no
BlueZ Low Energy ....................... no
Linux Crypto API ....................... no
Qt Sensors:
sensorfw ............................... no
Qt Multimedia:
ALSA ................................... no
GStreamer 1.0 .......................... no
GStreamer 0.10 ......................... no
Video for Linux ........................ no
OpenAL ................................. no
PulseAudio ............................. no
Resource Policy (libresourceqt5) ....... no
Windows Audio Services ................. yes
DirectShow ............................. yes
Windows Media Foundation ............... yes
Media player backend ................... DirectShow
Qt Quick Controls 2:
Styles ................................. Default Material Universal
Qt Quick Templates 2:
Hover support .......................... yes
Multi-touch support .................... yes
Qt Positioning:
Gypsy GPS Daemon ....................... no
WinRT Geolocation API .................. no
Qt Location:
Geoservice plugins:
OpenStreetMap ........................ yes
HERE ................................. yes
Esri ................................. yes
Mapbox ............................... yes
MapboxGL ............................. no
Itemsoverlay ......................... yesNote: Using static linking will disable the use of dynamically
loaded plugins. Make sure to import all needed static plugins,
or compile needed modules into the library.Note: When linking against OpenSSL, you can override the default
library names through OPENSSL_LIBS.
For example:
OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked -
Then the quick and dirty method would be to comment out the
win32
line inqtbase/src/plugins/printsupport/printsupport.pro
so the plugin doesn't get built. -
moc can't parse IID from this code block in qt5\qtbase\src\plugins\printsupport\windows\main.cpp(51):
class QWindowsPrinterSupportPlugin : public QPlatformPrinterSupportPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QPlatformPrinterSupportFactoryInterface_iid FILE "windows.json") public: QPlatformPrinterSupport *create(const QString &); };
Any idea what that means?
F:\Dev\qt5\build\qtbase\src\plugins\printsupport\windows>F:\Dev\qt5\build\qtbase\bin\moc.exe --compiler-flavor=msvc --include .moc/debug/moc_predefs.h -IF:/Dev/qt5/qtbase/mkspecs/win32-msvc -IF:/Dev/qt5/qtbase/src/plugins/printsupport/windows -IF:/Dev/qt5/qtbase/src/printsupport/kernel -IF:/Dev/qt5/build/qtbase/include/QtPrintSupport/5.9.2 -IF:/Dev/qt5/build/qtbase/include/QtPrintSupport/5.9.2/QtPrintSupport -IF:/Dev/qt5/build/qtbase/include/QtWidgets/5.9.2 -IF:/Dev/qt5/build/qtbase/include/QtWidgets/5.9.2/QtWidgets -IF:/Dev/qt5/build/qtbase/include/QtGui/5.9.2 -IF:/Dev/qt5/build/qtbase/include/QtGui/5.9.2/QtGui -IF:/Dev/qt5/build/qtbase/include -IF:/Dev/qt5/build/qtbase/include/QtPrintSupport -IF:/Dev/qt5/build/qtbase/include/QtWidgets -IF:/Dev/qt5/build/qtbase/include/QtGui -IF:/Dev/qt5/build/qtbase/include/QtCore/5.9.2 -IF:/Dev/qt5/build/qtbase/include/QtCore/5.9.2/QtCore -IF:/Dev/qt5/build/qtbase/include/QtCore -I. -IF:\Dependencies\openssl\1.1.0\vc141-x86-debug\include F:\Dev\qt5\qtbase\src\plugins\printsupport\windows\main.cpp -o .moc\debug\main.moc
F:\Dev\qt5\qtbase\src\plugins\printsupport\windows\main.cpp(51): Parse error at "IID" -
No, I don't see a direct reason for that. Can you test if the same happens when building for 64 bit ? (Shouldn't make difference but who knows...)
Note that you shouldn't need to pass the platform parameter.