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. Mysql in qt5
QtWS25 Last Chance

Mysql in qt5

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 8.2k 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.
  • A Offline
    A Offline
    ArcNexus
    wrote on last edited by
    #1

    Hi All.
    I have tested my application in Qt5 but I have a problem with mysql driver. It's not installed :-(

    I tried to compile the drive in Linux, but I have error. This is the command I have used for compile.

    @qmake "INCLUDEPATH+=/usr/include" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro@

    And the answer is:

    WARNING: /home/arcnexus/Qt5.0.0/5.0.0/Src/qtbase/src/plugins/sqldrivers/qsqldriverbase.pri:4: Unable to find file for inclusion qt_plugin Project MESSAGE: Warning: unknown QT: sql-private

    Please anyone know how to compile the driver in Qt5 and Linux?

    When we are one, we win

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Thanatos.jsse
      wrote on last edited by
      #2

      I have the same problem....

      Can anybody help us?

      Thank in advance.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        clochydd
        wrote on last edited by
        #3

        Hi All,

        after several hours I've finally found quite a simple solution:

        • Open the .pro in src/plugins/sqldrivers/psql (or mysql) with the Qt Creator.
        • Modify the include in the Build Settings
        • Build

        In my case and after a message in the Creator I had to create /plugins temporarily then build again and move the libqsqlpsql.so to Qt5.0.0/5.0.0/gcc_64/plugins/sqldrivers

        Works perfect now!

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ArcNexus
          wrote on last edited by
          #4

          Hi clochydd.

          Modify de include with.....?

          I don't understand.

          If I compile mysqldriver. when I build project I obtain this error:

          :-1: error: Unknown module(s) in QT: qt

          do you know also about this?

          When we are one, we win

          1 Reply Last reply
          0
          • C Offline
            C Offline
            clochydd
            wrote on last edited by
            #5

            Hi ArcNexus,

            in my case, I had to add "INCLUDEPATH+=/usr/include/postgresql" in the Build section and you should add a similar include for your mysqldriver.

            I had lots of error messages like "Unknown modules" etc. - but it was all solved the described way.

            I hope this may help you.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              ArcNexus
              wrote on last edited by
              #6

              Thanks :

              Yes, the problem is in the paths, I have solved this in part, but where is #include "main.moc"? I have searched this in my / directory but don't find it.

              this include is in my main.cpp. :-(

              When we are one, we win

              1 Reply Last reply
              0
              • C Offline
                C Offline
                clochydd
                wrote on last edited by
                #7

                "This might help":http://stackoverflow.com/questions/3001615/qt-moc-with-implementations-inside-of-header-files

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  ArcNexus
                  wrote on last edited by
                  #8

                  Thanks clocydd, I have solved it with compiling QBase code cloned from Github, in Archlinux

                  When we are one, we win

                  1 Reply Last reply
                  0

                  • Login

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