QT5.15.0, MySQL database, msvc2015_64 and Windows 10
-
Finally, it works! Thank you!
I just followed your advice and I copied the libmysql.dll to "C:\Qt\5.15.0\msvc2019_64\bin" after checked the presence of qsqlmysql.dll and qsqlmysqld.dll in sqldrivers.I tried to compile my project in QtCreator and it worked with mscv2019_64 so I think it's OK for me to use this one instead of the 2015 version.
The project compiles and it is able to connect to MySQL, I only get a warning from the Qtcreator console:
:-1: warning: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe" is used by qmake, but "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe" is configured in the kit. Please update your kit (Desktop Qt 5.15.0 MSVC2019 64bit) or choose a mkspec for qmake that matches your target environment better.
@Marcus-Barnet
That's a little weird, that path seems to be vs2015 compiler.
Check the Kits setting of QtCreator, make sure you select the right C/C++ compiler.
For vs2019_64 that should be 16.x.xxxxx.xx (amd64) -
This is my current configuration:
and I can select Visual C++ compiler16.6.30320.27 (amd64)
Should I switch to this other one?
-
This is my current configuration:
and I can select Visual C++ compiler16.6.30320.27 (amd64)
Should I switch to this other one?
@Marcus-Barnet said in QT5.15.0, MySQL database, msvc2015_64 and Windows 10:
and I can select Visual C++ compiler16.6.30320.27 (amd64)
Should I switch to this other one?Yes, change both C and C++ to 16.6.30320.27 (amd64)
-
I switched it, it compiled the first time my project and everything was OK.
I tried to compile it again and it gives me this error:
:-1: error: LNK1104: cannot open file 'release\PUMP.exe'
where PUMP.exe is my project executable.
I never had this problem before.
I also get this other warning:
yvals_core.h:462:2: error: STL1000: Unexpected compiler version, expected Clang 9.0.0 or newer. pump.h:1:1: note: in file included from C:\Qt\Examples\Qt-5.15.0\PUMP\pump.h:1: pump.h:4:10: note: in file included from C:\Qt\Examples\Qt-5.15.0\PUMP\pump.h:4: QMainWindow:1:10: note: in file included from C:\Qt\5.15.0\msvc2019_64\include\QtWidgets\QMainWindow:1: qmainwindow.h:43:10: note: in file included from C:\Qt\5.15.0\msvc2019_64\include\QtWidgets\qmainwindow.h:43: qtwidgetsglobal.h:43:10: note: in file included from C:\Qt\5.15.0\msvc2019_64\include\QtWidgets\qtwidgetsglobal.h:43: qtguiglobal.h:43:10: note: in file included from C:\Qt\5.15.0\msvc2019_64\include\QtGui\qtguiglobal.h:43: qglobal.h:45:12: note: in file included from C:\Qt\5.15.0\msvc2019_64\include\QtCore\qglobal.h:45: type_traits:9:10: note: in file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits:9:
pump.h is very simple:
#ifndef PUMP_H #define PUMP_H #include <QMainWindow> #include <QtSql> #include <QSqlDatabase> QT_BEGIN_NAMESPACE namespace Ui { class Pump; } QT_END_NAMESPACE class Pump : public QMainWindow { Q_OBJECT public: Pump(QWidget *parent = nullptr); ~Pump(); private slots: void on_pushButton_clicked(); private: Ui::Pump *ui; }; #endif // PUMP_H
-
PUMP.exe is created during the first compilation (I can run it) and then when I click on build again, it disappears and I get that error.
-
@Bonnie said in QT5.15.0, MySQL database, msvc2015_64 and Windows 10:
Do you use shadow build? Delete your build folder and try again.
Thank you for your support, everything works fine now!
@hskoglund: thank you to you, too, for your support!