Saturday, April 25, 2015

How-To: Create MySQL drivers in Qt for Windows


Hello! 


When installed, Qt lacks support for a series of SQL drivers such as that of MySQL, requiring the user to build them as he sees fit. This wouldn't be a major problem if there were easy-to-find manuals on the web or if Qt's own installation guide was clearer for starters - I remember it took something like 2 days for me to finally find the first working instructions when I first faced this problem (it was in Modh Amree's website which is now gone).

Regarding the not-so-much-new Qt 5, I found a clear instruction guide on Seppe Magiels' page (Create MySQL driver for Qt5 on Windows) which, as far as I can tell, is a correct (and clear) guide for doing this. The only significant difference between this guide and that of Amree's is that one step is lacking (probably due to changes in the Qt version) which is to repeat items 3 and 4 of the Step 4, but with "CONFIG+=release" appended to the call to qmake.


May the Lord be with you, always.