mysql plugin for QT

Posted on 2011-10-16
Last Modified: 2012-06-27

I have successfully built the mysql plugin for QT. The build process resulted in the following 4 files:


I copied the above files to the plugins directory of QT, and the .dll's to C:\windows\system32
Then I wrote sample code to test (see snippet 1). The code compiles, links and runs fine but i get no output.  According to
 the following code should output (see code snippet 2).
What am I doing wrong?
#include <QApplication>
      #include <QtSql>

      int main(int argc, char *argv[])
      QCoreApplication a(argc, argv);
      qDebug() << QSqlDatabase::drivers();
      return a.exec();

Open in new window

/* expected output */ 

Open in new window

Question by:arjoshi77
    LVL 7

    Accepted Solution

    can you try copying these files to Qt/bin folder and plugin folder
    LVL 4

    Assisted Solution

    Did you add the "CONFIG += console" line into your project file? Did you try to print just something before that line to check that outputting to the console works? No output at all sounds too suspicious to be caused just by MySQL plugin misconfiguration.
    LVL 7

    Assisted Solution

    yup he is right,
    try adding #include "qdebug.h" and following line of the code to get something out put on your either console or output window of IDE you are using.

    qDebug()<<"Testing is something is being printed";


    Author Closing Comment

    thanks. I implemented all of your advisories and i am able to get output.
    Thank you very much once again.
    LVL 7

    Expert Comment

    great, can you put the summary what exact steps helped it so that others can also get benefited from it.
    Thank for assigning the points

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
    The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now