⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

Problem with building MySql plugin

  • I need to use MySql with my app and trying to build the plugin. I tried to build plugins using the instruction

    cd $QTDIR/src/plugins/sqldrivers/mysql
    qmake "INCLUDEPATH+=/usr/local/include" "LIBS+=-L/usr/local/lib -lmysqlclient_r" mysql.pro

    after using the instruction with the qmake i got a warning saying
    WARNING: /home/azravian/qt-sources/qtbase/src/plugins/sqldrivers/qsqldriverbase.pri:4: Unable to find file for inclusion qt_plugin
    Project MESSAGE: Warning: unknown QT: core-private
    Project MESSAGE: Warning: unknown QT: sql-private

    And then using make give the output error as

    main.cpp:34:30: fatal error: qsqldriverplugin.h: No such file or directory
    #include <qsqldriverplugin.h>
    compilation terminated.
    make: *** [main.o] Error 1

    I have tried much but can't seem to solve it

  • Lifetime Qt Champion


    Where did you get Qt's sources ?
    Are you sure you are calling the qmake matching the version of Qt you are using ?

  • This post is deleted!

  • Lifetime Qt Champion

    Use the full path when calling qmake so you ensure that you are using the correct version.

  • @SGaist yes thank you for your reply. I called qmake from Qt5.5 and it worked finally.
    Thank you for your help

  • Lifetime Qt Champion

    You're welcome !

    Since you have it working now, please mark the thread as solved using the "Topic Tool" button so that other forum users may know a solution has been found :)

  • @SGaist yes sure sir
    Thanks Again for your kind help.

Log in to reply