I am not able to build Qt MySql Driver on windows.



  • Hello,
    I am not able to build Qt MYSQL driver on windows. SO I am using QODBC. Also how to ship it with installation file.



  • Why you can't build it? What error it shows?
    You can ship dlls with exe.



  • ya I have shipped dll with exe but it did not work at all.

    "I have tried to build QMYSQL driver with this":http://qt-project.org/doc/qt-4.8/sql-driver.html

    cd %QTDIR%\src\plugins\sqldrivers\mysql
    qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro
    nmake

    everything goes right except nmake. "namke not found"

    [quote author="qxoz" date="1362115930"]Why you can't build it? What error it shows?
    You can ship dlls with exe.[/quote]



  • Your Qt is for MSVS or MinGw?
    Anyway you can open mysql.pro with QtCreator and build it there.
    Try put plugin dlls in sqldrivers folder beside *.exe



  • its for MinGw
    [quote author="qxoz" date="1362119342"]Your Qt is for MSVS or MinGw?
    Anyway you can open mysql.pro with QtCreator and build it there.
    Try put plugin dlls in sqldrivers folder beside *.exe[/quote]



  • Just buld it from QtCreator.
    nmake is for MSVS compiler.



  • Oh thank you. One more thing.
    I have created several DLL for my project when i compile them using MSVS than it wont work when i use it as shared library in my project. But When i compile using mingw than it works.
    What may be the possible reason for this.



  • If you use Qt for MinGW then all your plugins(dlls) must be compiled with MinGW. MSVS and MinGW builds are not binary compatible.



  • I recommend you check this link out:
    http://seppemagiels.com/blog/create-mysql-driver-qt5-windows

    I fought and fought configuring and building Qt with a MySQL plugin and eventually ended up doing the same thing you are doing - using QODBC driver. Unfortunately I had the same deployment problems you are facing - requiring that every deployment machine have MySQL ODBC connector installed and setup. Not a huge pain for one machine, but certainly for multiple.

    To ensure I included all of the correct DLL libraries I used dependency walker:
    http://www.dependencywalker.com/

    On some target deployment machines (using ODBC) I had to include the SQLDRIVERS folder in the deployed application root directory.

    Hope that helps, goodluck!



  • Thank You :)
    [quote author="wakeuky" date="1362151167"]I recommend you check this link out:
    http://seppemagiels.com/blog/create-mysql-driver-qt5-windows

    I fought and fought configuring and building Qt with a MySQL plugin and eventually ended up doing the same thing you are doing - using QODBC driver. Unfortunately I had the same deployment problems you are facing - requiring that every deployment machine have MySQL ODBC connector installed and setup. Not a huge pain for one machine, but certainly for multiple.

    To ensure I included all of the correct DLL libraries I used dependency walker:
    http://www.dependencywalker.com/

    On some target deployment machines (using ODBC) I had to include the SQLDRIVERS folder in the deployed application root directory.

    Hope that helps, goodluck!
    [/quote]


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.