Cannot create the plugin of MYSQL for Qt
-
Hi, yes, I know there is a pinned thread at the top of this forum with a guide, but I've read that as well as every single website on the first three the pages of google and still cannot for the life of me figure this out.
I'm following this guide https://doc.qt.io/qt-5/sql-driver.html
The very first step is to run configure -help
I don't know what environment to run this command in, but every one that I've tried I get the same message : "'configure' is not recognized as an internal or external command, operable program or batch file."
Later in the page in says to remove config.cache from <QTDIR>/qtbase/src/plugins/sqldrivers , though that cache file does not exist in my directory.
When I run this : C:\Qt5\6.2.4\Src\qtbase\src\plugins\sqldrivers>qmake -- MYSQL_INCDIR="C:/Program Files/MySQL/MySQL Connector C 6.1/include" MYSQL_LIBDIR="C:/Program Files/MySQL/MySQL Connector C 6.1/lib"
nothing happens, and I get this output: Usage: qmake [mode] [options] [files]
QMake has two modes, one mode for generating project files based on
some heuristics, and the other for generating makefiles. Normally you
shouldn't need to specify a mode, as makefile generation is the default
mode for qmake, but you may use this to test qmake on an existing projectMode:
-project Put qmake into project file generation mode
In this mode qmake interprets [files] as files to
be added to the .pro file. By default, all files with
known source extensions are added.
Note: The created .pro file probably will
need to be edited. For example add the QT variable to
specify what modules are required.
-makefile Put qmake into makefile generation mode (default)
In this mode qmake interprets files as project files to
be processed, if skipped qmake will try to find a project
file in your current working directoryWarnings Options:
-Wnone Turn off all warnings; specific ones may be re-enabled by
later -W options
-Wall Turn on all warnings
-Wparser Turn on parser warnings
-Wlogic Turn on logic warnings (on by default)
-Wdeprecated Turn on deprecation warnings (on by default)Options:
- You can place any variable assignment in options and it will be *
- processed as if it was in [files]. These assignments will be *
- processed before [files] by default. *
-o file Write output to file
-d Increase debug level
-t templ Overrides TEMPLATE as templ
-tp prefix Overrides TEMPLATE so that prefix is prefixed into the value
-help This help
-v Version information
-early All subsequent variable assignments will be
parsed right before default_pre.prf
-before All subsequent variable assignments will be
parsed right before [files] (the default)
-after All subsequent variable assignments will be
parsed after [files]
-late All subsequent variable assignments will be
parsed right after default_post.prf
-norecursive Don't do a recursive search
-recursive Do a recursive search
-set <prop> <value> Set persistent property
-unset <prop> Unset persistent property
-query <prop> Query persistent property. Show all if <prop> is empty.
-qtconf file Use file instead of looking for qt6.conf, then qt.conf
-cache file Use file as cache [makefile mode only]
-spec spec Use spec as QMAKESPEC [makefile mode only]
-nocache Don't use a cache file [makefile mode only]
-nodepend Don't generate dependencies [makefile mode only]
-nomoc Don't generate moc targets [makefile mode only]
-nopwd Don't look for files in pwd [project mode only]
And when I run this command: $QTDIR/qtbase/src/plugins/sqldrivers> qmake -- MYSQL_PREFIX=/usr/local
I get the same exact list of help commands as above.I've downloaded countless libmysql.lib and libmysql.dll files and put them in nearly every directory that I can find, to no avail
Also, the nmake command is not recognized.
Please, someone point me in the right direction before I rip all of my hair out. I have staring at my computer for two days and my kids need me.
Thanks
-
Hi, depending on if you're using Qt5 or Qt6, there are two different flavors of building the MySql plugin. You had a bit of bad luck, you're using Qt 6.2.4 and the Qt5 guide for building it.
The guide for Qt6 is here: https://doc.qt.io/qt-6/sql-driver.html -
Wow, I knew it was going to be something under my nose like that.
When I run this: C:\Qt\6.2.4\mingw_64\bin>qt -cmake -G Ninja C:\Qt\6.2.4\Src\qtbase\src\plugins\sqldrivers -DMySQL_INCLUDE_DIR="C:\mysql-8.0.22-winx64\include" -DMySQL_LIBRARY="C:\mysql-8.0.22-winx64\lib\libmysql.lib" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.0.0\mingw81_64"
I get:
'qt' is not recognized as an internal or external command,
operable program or batch file.Also, would you happen to know where I should be running the configure command?
Thank you so much
-
@agomez said in Cannot create the plugin of MYSQL for Qt:
qt -cmake
It's
qt-qmake
as written in the documentation.