PDA

View Full Version : Migration from Qt 4.8 to Qt 5.12 Msvc 2017



aymenbest2
6th June 2019, 12:25
Hello everybody,

i m doing a migration from QT 4.8 to 5.12.3
i m using msvc 2017 and i get a strance compile error that happens in Qt src -- exactly in ../qt/5.12.3/msvc2017/include/QtCore/qjsonarray.h
please check the scrennshot below.
1314613147
could you please help me, thank you in advance
Cheers,

anda_skoa
7th June 2019, 08:31
Post the error, not a screenshot.

See the compile output tab for the full message

Cheers,
_

aymenbest2
7th June 2019, 09:01
Thanks anda_skoa
Here is the compile Output , thank you :

09:40:12: Running steps for project UnisetApplication...
09:40:12: Configuration unchanged, skipping qmake step.
09:40:12: Starting: "C:\Development\Qt5\Tools\QtCreator\bin\jom.exe"
( if not exist Makefile.Uniset C:\Development\Qt5\5.12.3\msvc2017\bin\qmake.exe -o Makefile.Uniset C:\Development\SVN\Qt_5_12\Uniset.pro -spec win32-msvc "CONFIG+=debug" "CONFIG+=qml_debug" ) && C:\Development\Qt5\Tools\QtCreator\bin\jom.exe -f Makefile.Uniset
C:\Development\Qt5\Tools\QtCreator\bin\jom.exe -f Makefile.Uniset.Debug
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(134): error C3646: "pointer": Unbekannter šberschreibungsspezifizierer
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(134): error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht untersttzt.
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(179): error C3646: "pointer": Unbekannter šberschreibungsspezifizierer
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(179): error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht untersttzt.
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(143): error C2440: "<function-style-cast>": "initializer list" kann nicht in "QJsonArray::iterator::QJsonValueRefPtr" konvertiert werden
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(143): note: Der Initialisierer enth„lt zu viele Elemente.
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(192): error C2440: "<function-style-cast>": "QJsonValue" kann nicht in "QJsonArray::const_iterator::QJsonValuePtr" konvertiert werden
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(192): note: Kein benutzerdefinierter Konvertierungsoperator verfgbar, der diese Konvertierung durchfhren kann, oder der Operator kann nicht aufgerufen werden
jom: C:\Development\SVN\Qt_5_12\Makefile.Uniset.Debug [debug\MeasureFunction.obj] Error 2
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(134): error C3646: "pointer": Unbekannter šberschreibungsspezifizierer
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(134): error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht untersttzt.
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(179): error C3646: "pointer": Unbekannter šberschreibungsspezifizierer
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(179): error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht untersttzt.
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(143): error C2440: "<function-style-cast>": "initializer list" kann nicht in "QJsonArray::iterator::QJsonValueRefPtr" konvertiert werden
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(143): note: Der Initialisierer enth„lt zu viele Elemente.
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(192): error C2440: "<function-style-cast>": "QJsonValue" kann nicht in "QJsonArray::const_iterator::QJsonValuePtr" konvertiert werden
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(192): note: Kein benutzerdefinierter Konvertierungsoperator verfgbar, der diese Konvertierung durchfhren kann, oder der Operator kann nicht aufgerufen werden

c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(134): error C3646: "pointer": Unbekannter šberschreibungsspezifizierer
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(134): error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht untersttzt.
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(179): error C3646: "pointer": Unbekannter šberschreibungsspezifizierer
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(179): error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht untersttzt.
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(143): error C2440: "<function-style-cast>": "initializer list" kann nicht in "QJsonArray::iterator::QJsonValueRefPtr" konvertiert werden
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(143): note: Der Initialisierer enth„lt zu viele Elemente.
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(192): error C2440: "<function-style-cast>": "QJsonValue" kann nicht in "QJsonArray::const_iterator::QJsonValuePtr" konvertiert werden
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(192): note: Kein benutzerdefinierter Konvertierungsoperator verfgbar, der diese Konvertierung durchfhren kann, oder der Operator kann nicht aufgerufen werden
Gui\MeasureWidgetForm\scmmeasure.cpp(83): warning C4150: L”schen eines Zeigers auf den nicht definierten Typ "Ui::SCMMeasure". Destruktor wurde nicht aufgerufen.
c:\development\svn\qt_5_12\gui\measurewidgetform\s cmmeasure.h(20): note: Siehe Deklaration von "Ui::SCMMeasure"
jom: C:\Development\SVN\Qt_5_12\Makefile.Uniset.Debug [debug\MeasureFunctionWidget.obj] Error 2
jom: C:\Development\SVN\Qt_5_12\Makefile.Uniset.Debug [debug\NoMotionAdapter.obj] Error 2
jom: C:\Development\SVN\Qt_5_12\Makefile.Uniset.Debug [debug\scmmeasure.obj] Error 2
jom: C:\Development\SVN\Qt_5_12\Makefile.Uniset.Debug [debug\OpticMeasureFunction_CONTOUR_FIT.obj] Error 2
Vision\ImageProcessing.cpp(800): error C2664: "void ImageProcessing::setActiveRoi(QRect &)" : Konvertierung von Argument 1 von "QRect" in "QRect &" nicht m”glich
Vision\ImageProcessing.cpp(800): note: Ein nicht konstanter Verweis kann nur an einen L-Wert gebunden werden.
Vision\ImageProcessing.cpp(1181): error C2664: "void ImageProcessing::setActiveRoi(QRect &)" : Konvertierung von Argument 1 von "QRect" in "QRect &" nicht m”glich
Vision\ImageProcessing.cpp(1181): note: Ein nicht konstanter Verweis kann nur an einen L-Wert gebunden werden.
jom: C:\Development\SVN\Qt_5_12\Makefile.Uniset.Debug [debug\ImageProcessing.obj] Error 2
jom: C:\Development\SVN\Qt_5_12\Makefile.Uniset.Debug [debug\topcamerawidget.obj] Error 2
jom: C:\Development\SVN\Qt_5_12\Makefile.Uniset.Debug [debug\measurewidgetform.obj] Error 2
jom: C:\Development\SVN\Qt_5_12\Makefile.Uniset [debug] Error 2
jom: C:\Development\SVN\Qt_5_12\Makefile [sub-Uniset-pro-make_first-ordered] Error 2
09:40:37: The process "C:\Development\Qt5\Tools\QtCreator\bin\jom.exe" exited with code 2.
Error while building/deploying project UnisetApplication (kit: Desktop Qt 5.12.3 MSVC2017 32bit)
When executing step "Make"
09:40:37: Elapsed time: 00:25.

anda_skoa
8th June 2019, 09:19
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(134): error C3646: "pointer": Unbekannter šberschreibungsspezifizierer
c:\development\qt5\5.12.3\msvc2017\include\qtcore\ qjsonarray.h(134): error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht untersttzt.

Very strange errors in qjsonarray.h

Probably caused by something included before that header. Try to change the include order to see which other header might be causing this.



Gui\MeasureWidgetForm\scmmeasure.cpp(83): warning C4150: L”schen eines Zeigers auf den nicht definierten Typ "Ui::SCMMeasure". Destruktor wurde nicht aufgerufen.
c:\development\svn\qt_5_12\gui\measurewidgetform\s cmmeasure.h(20): note: Siehe Deklaration von "Ui::SCMMeasure"

That sounds like if you are missing the include for scmmeasure_ui.h



Vision\ImageProcessing.cpp(800): error C2664: "void ImageProcessing::setActiveRoi(QRect &)" : Konvertierung von Argument 1 von "QRect" in "QRect &" nicht m”glich
Vision\ImageProcessing.cpp(800): note: Ein nicht konstanter Verweis kann nur an einen L-Wert gebunden werden.

Looks like you are trying to pass a temporary QRect to a function that expects a variable.

Cheers,
_

aymenbest2
18th June 2019, 09:04
Hello,
firstly, thank you very much for your help.
The issues was thas i have included a jsonbackport library to use it in qt 4.8.
During the migration the compiler found an #include<qJsonArray.h> what is definetly wrong to use since Qt 5.xx.
So the compile error wasn't appreciable i have to search to all Old include from the Json Lib and to change it like this
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>