Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Mysql in qt5

    General and Desktop
    3
    8
    7824
    Loading More Posts
    • 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
      ArcNexus last edited by

      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 Reply Quote 0
      • T
        Thanatos.jsse last edited by

        I have the same problem....

        Can anybody help us?

        Thank in advance.

        1 Reply Last reply Reply Quote 0
        • C
          clochydd last edited by

          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 Reply Quote 0
          • A
            ArcNexus last edited by

            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 Reply Quote 0
            • C
              clochydd last edited by

              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 Reply Quote 0
              • A
                ArcNexus last edited by

                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 Reply Quote 0
                • C
                  clochydd last edited by

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

                  1 Reply Last reply Reply Quote 0
                  • A
                    ArcNexus last edited by

                    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 Reply Quote 0
                    • First post
                      Last post