Solved QT 5.15.0 MSVC2015 program compile error: error C2664: "void QPainter::fillPath(const QPainterPath &,const QBrush &)" : Conversion of argument 1 from "int" to "const QPainterPath &" not possible
-
Hi and welcome to the forums
What happens if you just compile zint with 5.15 nonstatic.
does it still fail?Im wondering if its just a change in Qt between 5.7 and 5.15 or
its due to being static.Also tried to download the file in the link but it was a binary.
I wonder was is in line .\qzint.cpp(382) -
@Harald-Oehlmann Looks like you're just missing
#include <QPainterPath>
inqzint.cpp
.Btw you can cut that 3h compilation time if you exclude modules you don't use by using
-skip <module_name>
in your configure step. I usually leave about 4-5 core modules and it compiles in about 15 minutes. -
@Chris-Kawa
How many cores do you use ?
15 min is very good time :=) -
@mrjj Just your regular off the shelf 8 core i9 (16 threads). That's only the compilation step, excluding configure and install. As I said I only build core, widgets and a handful of smaller modules because that's all I need. The web and QML stuff can easily stretch that to hours.
-
@Chris-Kawa
Ok, i still run C4/T8 at home so 15 mins just seemed awesome to me but
i guess i should also try to exclude the QML stuff. Was not aware it would be that much extra :)
Thx -
@mrjj Thank you for the answer. This is highly appreciated.
May I answer to your questions ?What happens if you just compile zint with 5.15 nonstatic. does it still fail?
Do you mean to recompile qt without the static option ? This takes 3 hours of work. I am sorry, but this is not the aim and much work.
Im wondering if its just a change in Qt between 5.7 and 5.15 or its due to being static.
I have no idea
Also tried to download the file in the link but it was a binary.
The link goes to the release archive of zint 2.9. It is a .tar.gz file. I am sorry, if this is not suitable for you.
I wonder was is in line .\qzint.cpp(382)
There is the following line:
painter.fillPath(pt, QBrush(m_fgColor));
The whole context is as follows:
QPainterPath pt; pt.moveTo(hex->x, hex->y + (1.0 * radius)); pt.lineTo(hex->x + (0.86 * radius), hex->y + (0.5 * radius)); pt.lineTo(hex->x + (0.86 * radius), hex->y - (0.5 * radius)); pt.lineTo(hex->x, hex->y - (1.0 * radius)); pt.lineTo(hex->x - (0.86 * radius), hex->y - (0.5 * radius)); pt.lineTo(hex->x - (0.86 * radius), hex->y + (0.5 * radius)); pt.lineTo(hex->x, hex->y + (1.0 * radius)); painter.fillPath(pt, QBrush(m_fgColor));
Thank you again,
Harald
As the Forum allows only one post by me per day, I try to add the other answers here:
@Chris Kawa:
Thank you, that sounds great. Do you have exact instructions how to do that and how to modify the recipe? Remark that I use QT only for that and the big memory footprint on my harddisk also puzzles me...
-
Hi
do you mean to recompile qt without the static option?
No no, just compile the app with a normal Qt.
To see it that just works.I assume you do have
#include <QPainterPath> in qzint.cpp. as Chris Kawa asks?- the link goes to the release archive of zint 2.9. It is a .tar.gz file.
I get which seems to be a release and not source code ?
https://sourceforge.net/projects/zint/files/zint/2.9.0/zint-2.9.0_win32_cmd_tcl.zip/downloadps. I bumped you so you should be able to answer faster/more.
-
@mrjj Thank you for the reply:
First, I want express again my appolyse to contact here as a novice user.
Sorry, the URL is:
https://sourceforge.net/projects/zint/files/zint/2.9.0/zint-2.9.0.tar.gz/downloadSorry, I don't know what a "normal Qt" is. Is the QT used by me not normal ?
I suppose, the static build is the most used and most normal out there as anything else leeds into DLL hell we had before within the project.No, I don't see QPainterPath as include. The contained includes within the file are:
#include "qzint.h" #include <stdio.h> #include <math.h> #include <QFontMetrics>
qzint.h containes the following includes:
#include <QColor> #include <QPainter>
May I add the proposed include somewhere ?
After which other include ?Remark, that it should still compile with QT 5.12.4, what is currently used on Linux Operating System. Currently, it compiles there without any reported issues.
May I also add some extract from the eventually relevant backend_qt.pro file:
TEMPLATE = lib CONFIG += staticlib macx{ CONFIG -= dll CONFIG += lib_bundle } TARGET = QtZint
Thank you,
Harald -
Hi
Np :)
Yes just add the include and see if that helps. ( in cpp should do it )By normal, i just mean the one you normally get installed from the site.
Its none static and it was only to see if it just runs.But you seem to have tested that already
- Remark, that it should still compile with QT 5.12.4, what is currently used on Linux Operating System. Currently, it compiles there without any reported issues.
-
@mrjj Thank you a lot, that vanished the issue.
The error is gone.Now, I have only a remaining link error:
link /NOLOGO /DYNAMICBASE /NXCOMPAT /OPT:REF /INCREMENTAL:NO /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:release\qtZint.exe @C:\Users\oehhar\AppData\Local\Temp\nmEB22.tmp LINK : fatal error LNK1181: Eingabedatei "Qt5Core.lib" kann nicht geöffnet werden. NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.EXE"": Rückgabe-Code "0x49d" Stop.
The required library is present in "c:\qt\5.15.0static\lib".
Thus, I suppose, there is a path issue.The set environment variables are:
set QTDIR=C:\Qt\5.15.0static set PATH=C:\Qt\5.15.0static\bin;%PATH% set QMAKESPEC=win32-msvc
Adding:
set QMAKE_LIBDIR=C:\Qt\5.15.0static\lib
did not help.
The relevant frontend_qt.pro line is:
LIBS += -lQtZint -lQt5Core QMAKE_LIBDIR += ../backend_qt/release
Adding here:
QMAKE_LIBDIR += C:/qt/5.15.1static/lib
did the job, but is not very plesant to the other supported platforms.
In addition, it points to my local laptop.
But if this is required, it is required.Thank you all for solving this and best regards,
Harald