Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Issue compiling mysql driver...
QtWS25 Last Chance

Issue compiling mysql driver...

Scheduled Pinned Locked Moved Solved General and Desktop
mysqldriver
3 Posts 2 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mbruel
    wrote on 17 Dec 2015, 19:10 last edited by
    #1

    Hi.
    I've managed to compile the driver and use it on my laptop where I installed QT with the online installer.
    I downloaded the source qtbase-opensource-src-5.5.1.tar.gz and used

    /opt/Qt5.5.1/5.5/gcc/bin/qmake "INCLUDEPATH+=/usr/include" "LIBS+=-L/usr/lib/i386-linux-gnu -lmysqlclient_r" mysql.pro
    make
    

    I'm trying now to compile it on a remote server where QT was installed with the packet manager (debian jessie).
    As qmake -version return 5.3.2, I've downloaded the source of that version: qtbase-opensource-src-5.3.2.tar.gz and trying to do the same:

    ~/tmp/qtbase-opensource-src-5.3.2/src/plugins/sqldrivers/mysql$ qmake "INCLUDEPATH+=/usr/include""LIBS+=-L/usr/lib/x86_64-linux-gnu -lmysqlclient_r" mysql.pro
    
    ~/tmp/qtbase-opensource-src-5.3.2/src/plugins/sqldrivers/mysql$ make
    g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -I/usr/include/mysql -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++-64 -I. -isystem /usr/include -I../../../../src -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql/5.3.2 -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql/5.3.2/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore/5.3.2 -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore/5.3.2/QtCore -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I.moc -o .obj/qsql_mysql.o ../../../sql/drivers/mysql/qsql_mysql.cpp
    ../../../sql/drivers/mysql/qsql_mysql.cpp:44:40: fatal error: QtSql/private/qsqldriver_p.h: No such file or directory
     #include <QtSql/private/qsqldriver_p.h>
                                            ^
    compilation terminated.
    Makefile:379: recipe for target '.obj/qsql_mysql.o' failed
    make: *** [.obj/qsql_mysql.o] Error 1
    

    it seems there are no qsqldriver_p.h in my /usr/include/x86_64-linux-gnu/qt5/.
    Any idea why?
    The only place I find it is in the source folder: ~/tmp/qtbase-opensource-src-5.3.2/src/sql/kernel/qsqldriver_p.h

    PS: I checked in my lib folder to see which database drivers I have and there is only sqllite so I'll definitely need to compile the mysql one.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 18 Dec 2015, 00:56 last edited by
      #2

      Hi,

      Do I understand you correctly: you are trying to build the Qt MySQL driver using the distribution provided Qt ? If so, why ? Your distribution should also provide you with pre-compiled Qt SQL drivers

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mbruel
        wrote on 18 Dec 2015, 14:20 last edited by
        #3

        You're understanding correctly...
        Well I just had to build it on my laptop for QT 5.51 because the current version of the driver wasn't working with mysql 5.5. It was quite a simple process...
        I wanted to try my program on a remote server, noticed the driver wasn't present at all, so just thought I'll build it myself to be sure it will be compatible with the version of mysql installed.
        You're right, I've found the package in my distribution and it is working well. (libqt5sql5-mysql on debian jessie)
        Thanks

        1 Reply Last reply
        0

        3/3

        18 Dec 2015, 14:20

        • Login

        • Login or register to search.
        3 out of 3
        • First post
          3/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved