Qt 5.15.2 MinGW 32-bit throwing errors but 64-bit version working fine.
-
I am trying to build 32-bit application after successfully building the 64-bit.
However, after setting up my kit and trying to run the application it produces a lot of errors while building for 64-bit works fine.
the first error is this one:
\ui_mainwindow.h:13: error: QtGui/QAction: No such file or directory In file included from mainwindow.cpp:2: ui_mainwindow.h:13:10: fatal error: QtGui/QAction: No such file or directory #include <QtGui/QAction> ^~~~~~~~~~~~~~~
Then some errors with
connect
, like this one:connect(ui->to, &QSpinBox::valueChanged, [this]() { ui->from->setMaximum(ui->to->value()); });
The code above throws the following error:
playlistdialog.cpp:39: error: no matching function for call to 'PlaylistDialog::connect(QSpinBox*&, <unresolved overloaded function type>, PlaylistDialog::PlaylistDialog(QString, QString, int, int, int, QWidget*)::<lambda()>)' playlistdialog.cpp:39:6: error: no matching function for call to 'PlaylistDialog::connect(QSpinBox*&, <unresolved overloaded function type>, PlaylistDialog::PlaylistDialog(QString, QString, int, int, int, QWidget*)::<lambda()>)' }); ^
There are a couple more errors similar to the one above.
And then some more similar errors:
videoFormats = {"mp4"/*, "webm", "flv", "3gp", "avi"*/};
Throws this error:
\playlistdialog.cpp:65: error: ambiguous overload for 'operator=' (operand types are 'QStringList' and '<brace-enclosed initializer list>') playlistdialog.cpp:65:59: error: ambiguous overload for 'operator=' (operand types are 'QStringList' and '<brace-enclosed initializer list>') videoFormats = {"mp4"/*, "webm", "flv", "3gp", "avi"*/}; ^
I can't see the reason for these 3 type of errors since they are working fine in Qt 5.15.2 MinGW 64-bit.
Any idea?? Thanks!!
-
Hi,
Are you using a 32bit build of Qt ?
-
@hbatalha said in Qt 5.15.2 MinGW 32-bit throwing errors but 64-bit version working fine.:
#include <QtGui/QAction>
This is Qt4. Are you sure you installed Qt4/32bit correctly? I would guess no.
Make sure the correct uic compiler is picked up (the Qt5 one) if you have installed and want to use Qt5 -
@hbatalha And what do you want to tell with us? It's completely irrelevant what Qt version or what else your IDE is using...
-
@Christian-Ehrlicher Sorry, where can I find the info you requested me?
-
In the Kit settings
-
@hbatalha said in Qt 5.15.2 MinGW 32-bit throwing errors but 64-bit version working fine.:
I am trying to build 32-bit application after successfully building the 64-bit.
Did the same project successfully built in 64-bit?
looks like uic compiler of Qt4 version is linked, clean and rebuild the project.
check whether generated "ui_mainwindow.h" file having current timestamp.
have a look into makefile and check whether it's reflecting the valid settings.
(QMAKE/CXXFLAGS) -
@nagesh said in Qt 5.15.2 MinGW 32-bit throwing errors but 64-bit version working fine.:
Did the same project successfully built in 64-bit?
I came to realize that the 64-bit that built successfully is the Qt 6.0.0 mingw 64 bit and Qt 6.0.1 mingw 64 bit not Qt 5.15.2 mingw 64 bit as I don't have it installed.
clean and rebuild the project.
Did that multiple times, same result
check whether generated "ui_mainwindow.h" file having current timestamp.
Didn't understand, how do I do that?
have a look into makefile and check whether it's reflecting the valid settings.
How will I know if it not reflecting valid settings
-
@Christian-Ehrlicher said in Qt 5.15.2 MinGW 32-bit throwing errors but 64-bit version working fine.:
Make sure the correct uic compiler is picked up (the Qt5 one) if you have installed and want to use Qt5
How will I check that?
-
@nagesh So I uinstalled Qt 5.15.2 MinGW 32-bit and installed Qt 5.15.1 MinGW 32-bit(just for the sake of trying), same results
search for bin/uic and confirm it's from the currect version..
C:/Qt/5.15.1/mingw81_32/bin/uic.exe
That is what I found, I guessing it is right version
-
As I already said - either there is a uic.exe from Qt4 around or you checked in the generated ui_mainwindow.h (which also then was created with a Qt4 uic) - remove both.
-
remove both.
To remove uic.exe and the generated ui_mainwindow.h???
Sorry I don't understand what exactly you are telling me to do.either there is a uic.exe from Qt4 around
I would guess no. Is there any possible scenario where you would download compilers only from qt5 and end up with some files from qt4 in them?
-
Remove the ui_mainwindow.h - it was created with an uic.exe from Qt4.
-
@Christian-Ehrlicher I did that and it solved the first error. But I am still left with the other 2 types of compiling error mentioned in the OP.
-
The documentation to QSpinBox::valueChanged() exectly desribes your problem. Reading docs is sometimes useful...
-
@Christian-Ehrlicher yeah it works, but still... when I compile using Qt 6.0.1 64-bit it works fine, it should work.
The problem is not really the compile errors, it is why my code works fine using Qt 6.0.1 64-bit and fails when using Qt 5.15.1/2 32-bit.
In the OP I posted 3 errors but it is really 3 type of errors, there are a lot more than just 3 errors all over my project and also there are other type of errors.
I tried commenting the lines that threw the errors and it compiled successfully and thus a question arose: will I have to rewrite everything so it can compile in 32-bit?? That doesn't seem right to me, I don't think it is supposed to be this way.
-
Because the overloads triggering the compilation error have been either renamed or removed in Qt 6.