migrate from Qt5.11 to 6
-
It's an option you select in the online installer or maintenance tool.
-
ok i did try to follow everyones advice, i used the maintainance tool and updated to Qt 6 and also Mingw that is provided with Qt, under the Tools folder got
mingw 530_32
mingw730_32
mingw730_64
mingw810_32
mingw810_64im using the g++ from mingw810_64 and the qmake from Qt 6.1.2 but still got too many warnings. heres the paste.bin with all the warnings, link text
Edit: im not so sure, but under the bin folder theres also several files that looks like this- x86_64-w64-mingw32-c++, x86_64-w64-mingw32-g++, etc
-
ok i did try to follow everyones advice, i used the maintainance tool and updated to Qt 6 and also Mingw that is provided with Qt, under the Tools folder got
mingw 530_32
mingw730_32
mingw730_64
mingw810_32
mingw810_64im using the g++ from mingw810_64 and the qmake from Qt 6.1.2 but still got too many warnings. heres the paste.bin with all the warnings, link text
Edit: im not so sure, but under the bin folder theres also several files that looks like this- x86_64-w64-mingw32-c++, x86_64-w64-mingw32-g++, etc
@Lightshadown said in migrate from Qt5.11 to 6:
heres the paste.bin with all the warnings, link text
- Your log contains references to both Qt 6.12 and Qt 5.11.3. Something has gotten horribly mixed up somewhere. Delete all of your build files and start with a clean slate. Also, make sure that Qt and MinGW are not in your global system PATH.
- You said you are using g++ from Qt's mingw810_64 -- are you sure? I see a reference to C:\MinGW\msys\1.0\bin\
Also, it looks like you're building from the MSYS shell. Sometimes, using the Windows Command Prompt provides better results.
@Lightshadown said in migrate from Qt5.11 to 6:
I have a program i develop in Qt 5.11 using mingw32, it works fine but i want to migrate to 64bits programs so i need either Qt5,14 o Qt 6
The recommended migration path is Qt 5.11 -> Qt 5.15 -> Qt 6.x
You should port to Qt 5.15 first and fix all deprecation warnings before you try to port to Qt 6.
-
ok, it seems my PATH was a complete mess, i erased everything related to qt and ming, i only left the location of make C:\MinGW\msys\1.0\bin and it seems to work kinda ok, now it get other warnings related to things like QApplication::desktop()->size() not a member of QApplication and layout()->setMargin(0), QLayout has no member call set margin or (this is strange), errors like sstream seems to miss a dll, but that seems to be related to changes on QT 6, now i need to figure it out how to fix them, sadly this is part of a repo i downloaded from Github so no way to ask the owner.
Right now will try to find the equivalents to my code, thanks, heres the output https://pastebin.com/vPYy7hfU
-
ok, it seems my PATH was a complete mess, i erased everything related to qt and ming, i only left the location of make C:\MinGW\msys\1.0\bin and it seems to work kinda ok, now it get other warnings related to things like QApplication::desktop()->size() not a member of QApplication and layout()->setMargin(0), QLayout has no member call set margin or (this is strange), errors like sstream seems to miss a dll, but that seems to be related to changes on QT 6, now i need to figure it out how to fix them, sadly this is part of a repo i downloaded from Github so no way to ask the owner.
Right now will try to find the equivalents to my code, thanks, heres the output https://pastebin.com/vPYy7hfU
@Lightshadown said in migrate from Qt5.11 to 6:
now it get other warnings related to things like QApplication::desktop()->size() not a member of QApplication and layout()->setMargin(0), QLayout has no member call set margin
That's why I suggested that you migrate to Qt 5.15 first. When you build in Qt 5.15, you get deprecation warnings instead of compilation errors. Often, the warnings will also tell you how to replace the deprecated functions.
Alternatively, you can check the Qt 5 documentation: https://doc.qt.io/qt-5/qlayout-obsolete.html#margin-prop
All the functions/classes that are deprecated in Qt 5 no longer exist in Qt 6. After you have fixed the deprecation warnings for your app in Qt 5.15, it becomes a lot easier to port your app to Qt 6.
ok, it seems my PATH was a complete mess, i erased everything related to qt
I highly discourage adding Qt to the system PATH. It can cause DLL Hell and break other apps that depend on a different versions of Qt.
-
@Lightshadown said in migrate from Qt5.11 to 6:
now it get other warnings related to things like QApplication::desktop()->size() not a member of QApplication and layout()->setMargin(0), QLayout has no member call set margin
That's why I suggested that you migrate to Qt 5.15 first. When you build in Qt 5.15, you get deprecation warnings instead of compilation errors. Often, the warnings will also tell you how to replace the deprecated functions.
Alternatively, you can check the Qt 5 documentation: https://doc.qt.io/qt-5/qlayout-obsolete.html#margin-prop
All the functions/classes that are deprecated in Qt 5 no longer exist in Qt 6. After you have fixed the deprecation warnings for your app in Qt 5.15, it becomes a lot easier to port your app to Qt 6.
ok, it seems my PATH was a complete mess, i erased everything related to qt
I highly discourage adding Qt to the system PATH. It can cause DLL Hell and break other apps that depend on a different versions of Qt.
@JKSH i did follow your advice and installed Qt 5.15 and using the mingw that is provided with Qt tools/mingw810_64 also i erased all related to Qt on the PATH but instead of deprecated warnings i get no defined or double definition errors from even the basic files, im pasting my log but its kinda odd, something like this
In file included from c:/Qt14/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/cctype:42, from c:/Qt14/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/localefwd.h:42, from c:/Qt14/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/string:43, from C:/Qt14/5.15.0/mingw81_64/include/QtCore/qbytearray.h:52, from C:/Qt14/5.15.0/mingw81_64/include/QtCore/qstring.h:50, from C:/Qt14/5.15.0/mingw81_64/include/QtPrintSupport/qprinter.h:44, from C:/Qt14/5.15.0/mingw81_64/include/QtPrintSupport/QPrinter:1, from Impresora.h:16, from Impresora.cpp:13: c:/Qt14/Tools/mingw810_64/x86_64-w64-mingw32/include/wctype.h:135:29: error: expected ',' or '...' before numeric constant int __cdecl iswblank(wint_t _C); ^~ In file included from c:/Qt14/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/memory:74, from C:/Qt14/5.15.0/mingw81_64/include/QtCore/qsharedpointer_impl.h:70, from C:/Qt14/5.15.0/mingw81_64/include/QtCore/qsharedpointer.h:48, from C:/Qt14/5.15.0/mingw81_64/include/QtGui/qpagelayout.h:44, from C:/Qt14/5.15.0/mingw81_64/include/QtGui/qpagedpaintdevice.h:45, from C:/Qt14/5.15.0/mingw81_64/include/QtPrintSupport/qprinter.h:46, from C:/Qt14/5.15.0/mingw81_64/include/QtPrintSupport/QPrinter:1, from Impresora.h:16, from Impresora.cpp:13: c:/Qt14/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/ext/concurrence.h:124:5: error: '__gthread_mutex_t' does not name a type; did you mean '__gthread_mutex_lock'? __gthread_mutex_t _M_mutex; ^~~~~~~~~~~~~~~~~ __gthread_mutex_lock
heres my full log paste.bin https://pastebin.com/Ecms50w8
Edit: i did try using mingw32-make.exe but it said its incompatible and should use MSYS
-
@JKSH i did follow your advice and installed Qt 5.15 and using the mingw that is provided with Qt tools/mingw810_64 also i erased all related to Qt on the PATH but instead of deprecated warnings i get no defined or double definition errors from even the basic files, im pasting my log but its kinda odd, something like this
In file included from c:/Qt14/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/cctype:42, from c:/Qt14/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/localefwd.h:42, from c:/Qt14/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/string:43, from C:/Qt14/5.15.0/mingw81_64/include/QtCore/qbytearray.h:52, from C:/Qt14/5.15.0/mingw81_64/include/QtCore/qstring.h:50, from C:/Qt14/5.15.0/mingw81_64/include/QtPrintSupport/qprinter.h:44, from C:/Qt14/5.15.0/mingw81_64/include/QtPrintSupport/QPrinter:1, from Impresora.h:16, from Impresora.cpp:13: c:/Qt14/Tools/mingw810_64/x86_64-w64-mingw32/include/wctype.h:135:29: error: expected ',' or '...' before numeric constant int __cdecl iswblank(wint_t _C); ^~ In file included from c:/Qt14/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/memory:74, from C:/Qt14/5.15.0/mingw81_64/include/QtCore/qsharedpointer_impl.h:70, from C:/Qt14/5.15.0/mingw81_64/include/QtCore/qsharedpointer.h:48, from C:/Qt14/5.15.0/mingw81_64/include/QtGui/qpagelayout.h:44, from C:/Qt14/5.15.0/mingw81_64/include/QtGui/qpagedpaintdevice.h:45, from C:/Qt14/5.15.0/mingw81_64/include/QtPrintSupport/qprinter.h:46, from C:/Qt14/5.15.0/mingw81_64/include/QtPrintSupport/QPrinter:1, from Impresora.h:16, from Impresora.cpp:13: c:/Qt14/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/ext/concurrence.h:124:5: error: '__gthread_mutex_t' does not name a type; did you mean '__gthread_mutex_lock'? __gthread_mutex_t _M_mutex; ^~~~~~~~~~~~~~~~~ __gthread_mutex_lock
heres my full log paste.bin https://pastebin.com/Ecms50w8
Edit: i did try using mingw32-make.exe but it said its incompatible and should use MSYS
@Lightshadown said in migrate from Qt5.11 to 6:
i did try using mingw32-make.exe but it said its incompatible and should use MSYS
- Remove C:\MinGW\msys\1.0\bin from your PATH
- Delete your build folders
- Use the Windows Command Prompt (cmd.exe) rather than MSYS
- Use C:\Qt14\Tools\mingw810_64\bin\mingw32-make.exe rather than C:\MinGW\msys\1.0\bin\make.exe
What happens now?
-
@Lightshadown said in migrate from Qt5.11 to 6:
i did try using mingw32-make.exe but it said its incompatible and should use MSYS
- Remove C:\MinGW\msys\1.0\bin from your PATH
- Delete your build folders
- Use the Windows Command Prompt (cmd.exe) rather than MSYS
- Use C:\Qt14\Tools\mingw810_64\bin\mingw32-make.exe rather than C:\MinGW\msys\1.0\bin\make.exe
What happens now?
- done no reference to qt or msys on the PATH
- deleted as well
- not sure how to do that, im using Netbeans and its not so clear as how to do that, i can use VS code but im unable to link the libraries not sure how,
- i just did that but it keeps saying its not suported, plz check the images below
also i did try this
not sure what to do, im tempeted to leave it in Qt 5.11, the alternative its redo ALL THE CODE from scratch and thats a big no.
Any help is welcome -
- done no reference to qt or msys on the PATH
- deleted as well
- not sure how to do that, im using Netbeans and its not so clear as how to do that, i can use VS code but im unable to link the libraries not sure how,
- i just did that but it keeps saying its not suported, plz check the images below
also i did try this
not sure what to do, im tempeted to leave it in Qt 5.11, the alternative its redo ALL THE CODE from scratch and thats a big no.
Any help is welcome@Lightshadown said in migrate from Qt5.11 to 6:
i just did that but it keeps saying its not suported
So Netbeans doesn't support it. Qt Creator does.
OK, try switching back to your MSYS Make with C:\Qt\Tools\mingw810_64\bin\g++.exe (After doing steps #1 and #2 in my previous post)
Anyway, Qt 6.1 uses the same version of MinGW as Qt 5.15. What's in your "MinGW64__Qt_6.1.2" settings? Use the same for Qt 5.15.
- not sure how to do that, im using Netbeans and its not so clear as how to do that
I've never used Netbeans before so I don't know what it can and can't do, sorry.
-
@Lightshadown said in migrate from Qt5.11 to 6:
i just did that but it keeps saying its not suported
So Netbeans doesn't support it. Qt Creator does.
OK, try switching back to your MSYS Make with C:\Qt\Tools\mingw810_64\bin\g++.exe (After doing steps #1 and #2 in my previous post)
Anyway, Qt 6.1 uses the same version of MinGW as Qt 5.15. What's in your "MinGW64__Qt_6.1.2" settings? Use the same for Qt 5.15.
- not sure how to do that, im using Netbeans and its not so clear as how to do that
I've never used Netbeans before so I don't know what it can and can't do, sorry.
@JKSH im gona leave it in Qt 5.11 it seems the problem its netbeans itself for some reason it simply wont compile in a diferente version of Qt, in the Qt MinGW64__Qt_6.1.2" settings theres exacly the same as the 5.15, just the qmake its diferent (qmake for 5.15)