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. [Solved] MySQL Driver C++
Forum Updated to NodeBB v4.3 + New Features

[Solved] MySQL Driver C++

Scheduled Pinned Locked Moved General and Desktop
19 Posts 3 Posters 12.1k Views 1 Watching
  • 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
    andre
    wrote on last edited by
    #10

    You can set it as an environment variable. You can even do that directly from Qt creator: go to the Projects tab on the right side, and swich to the right project and the Run Settings (at the top of the tab). In the list of options, you'll find a Run Environment box. Expand it using the Details button on the right, and add the Q_DEBUG_PLUGINS variable to the list, giving it the value 1.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      larsjuh
      wrote on last edited by
      #11

      Thanks, i've found it.. But where can i find debug info? because it doesn't show up in "Application Output"

      https://dl.dropbox.com/u/40400405/q_debug.png

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #12

        Sorry, my fault, it should be QT_DEBUG_PLUGINS.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          larsjuh
          wrote on last edited by
          #13

          This is the output (its on pastebin, couldn't post it here..)

          http://pastebin.com/tjga3UPy

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #14

            That's a nice bunch of output. What does it tell you? I could of course analyze it for you, but the point is that it would be more useful for the both of us if you learn to do that yourself...

            1 Reply Last reply
            0
            • L Offline
              L Offline
              larsjuh
              wrote on last edited by
              #15

              The output is what i understand, it tells me that the dll's and .a files are incompatible sortwise.

              But why it is, is something i don't understand. I compiled it using MinGW..

              What did i do wrong?

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #16

                Let us first filter it down to the relevant entries, the ones about your mysql dll's:

                [quote]
                QFactoryLoader::QFactoryLoader() looking at "C:/QtSDK/Desktop/Qt/4.8.1/mingw/plugins/sqldrivers/qsqlmysql4.dll"
                In C:/QtSDK/Desktop/Qt/4.8.1/mingw/plugins/sqldrivers/qsqlmysql4.dll:
                Plugin uses incompatible Qt library
                expected build key "Windows mingw debug full-config", got "Windows mingw release full-config"
                "The plugin 'C:/QtSDK/Desktop/Qt/4.8.1/mingw/plugins/sqldrivers/qsqlmysql4.dll' uses incompatible Qt library. Expected build key "Windows mingw debug full-config", got "Windows mingw release full-config""
                not a plugin
                [/quote]
                Ok, seems you are running a debug version of your app, with a debug Qt library, and that means you cannot load a release version... Makes sense, and the lack of a 'd' in the name of the library also indicates a release version. So far, no worries.
                [quote]
                QFactoryLoader::QFactoryLoader() looking at "C:/QtSDK/Desktop/Qt/4.8.1/mingw/plugins/sqldrivers/qsqlmysqld4.dll"
                QLibraryPrivate::loadPlugin failed on "C:/QtSDK/Desktop/Qt/4.8.1/mingw/plugins/sqldrivers/qsqlmysqld4.dll" : "Cannot load library C:/QtSDK/Desktop/Qt/4.8.1/mingw/plugins/sqldrivers/qsqlmysqld4.dll: "
                "Cannot load library C:/QtSDK/Desktop/Qt/4.8.1/mingw/plugins/sqldrivers/qsqlmysqld4.dll: "
                could not load
                [/quote]
                Now it starts to get serious. Qt tried to load this plugin, but failed. The library failed to load, but it does not tell you why. Time to debug that further. Usually, when a library fails to load, it misses a dependency. So, get yourself a copy of the dependency walker tool to figure out what library the driver is trying to load and fails at. I can guess which one though: a core mysql library. Did you really follow the guide I linked to before? Including step 6?

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  larsjuh
                  wrote on last edited by
                  #17

                  Thanks alot for your time !! really appreciated..

                  I remember i copied the 64 bit DLL version of libmysql.dll into C:\Windows

                  That was the problem, now i copied the 32bit, and it works.

                  Thanks!!

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    andre
                    wrote on last edited by
                    #18

                    Please add a [Solved] tag to the topic title (by editing your first post in the topic) if you feel your problem has been solved.

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      anubhav87
                      wrote on last edited by
                      #19

                      Where will i get
                      libqsqlmysql4.a
                      libqsqlmysqld4.a

                      Thanks

                      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