Problems with configuring SQL when building Qt 5.8 from source
I tried building the new Qt 5.8 using the same configuration I have been using since 5.5, but it failed with the following errors:
ERROR: Invalid value given for boolean command line option 'sql-psql'. ERROR: Invalid value given for boolean command line option 'sql-mysql'. ERROR: Unknown command line option '-l'. Qmake failed, return code 3
The errors are product of those 3 configuration options:
-qt-sql-psql -qt-sql-mysql -l mysqlclient
So I changed them to:
-sql-psql -sql-mysql -L mysqlclient
That didn't produce the same errors from above, but configuration failed nevertheless:
ERROR: Feature 'sql-mysql' was enabled, but the pre-condition 'libs.mysql' failed.
Here is the full list of the SQL related configuration options:
-L E:\msys64\mingw64\lib -qt-sql-psql -qt-sql-mysql -l mysqlclient -I E:\msys64\mingw64\include\mariadb
What is going on here? What has changed? Why is the option to specify that I want build in rather than plug in SQL drivers on accepted? What is that pre-condition and why does it fail?
Also, IIRC the -l option was to include a pre-built library, why is that not working anymore? With a capital -L it is to include a library path, not a particular library. Oddly enough the configuration detects the psql libray, but not the mysql, I am using mariadb in this particular case.
The documentation (it says it is for 5.8) still lists the same old ways to configure SQL:
-no-sql-<driver> ... Disable SQL <driver> entirely. -qt-sql-<driver> ... Enable a SQL <driver> in the Qt Library, by default none are turned on. -plugin-sql-<driver> Enable SQL <driver> as a plugin to be linked to at run time. Possible values for <driver>: [ db2 ibase mysql oci odbc psql sqlite sqlite2 tds ]
However the -qt-sql-psql format results in an error.
How to properly configure Qt to build with mysql and psql support?
@iter The second option is correct.
The problem reported after that is that the test for mysql failed. Can you show the details of the configure process. It should show the tests (although those may be in a more verbose mode).
And from those tests we may gain some insight as to why your mysql isn't working. It could be for quite a few reasons including different architecture of the mysql libs, not being able to find the includes or the libraries, etc. A lot of reasons really.
Nope, the libs are built with GCC 5.3.0 x64, exactly the same compiler I am trying to build Qt with.
Furthermore I am able to build Qt 5.7 and 5.7.1 with mysql using those exact same libraries. The configuration script for 5.7.1 detects mysql, but not for 5.8.
I am not sure what do you mean by the "configure process", but if it is the full configuration option list, this is it:
configure -c++std c++11 -prefix E:\Qt\Qt58s -platform win32-g++ -release -opensource -static -static-runtime -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -no-compile-examples -no-icu -opengl desktop -skip qtscript -nomake examples -nomake tests -skip qtwayland -skip qtwebview -skip qtwebengine -skip qtwebchannel -no-qml-debug -confirm-license -sql-psql -sql-mysql -L E:\msys64\mingw64\lib -I E:\msys64\mingw64\include\mariadb
@iter I meant the output from configure. So when you run configure redirect that output to a file and post the contents. Make sure you redirect stderr too.
./configure &> config-results.
Oh and I haven't built 5.8 yet, so it's possible it's just broken. I doubt it though, that's a pretty big thing to miss in QA.