mysql plugin for QT

Hello:

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

qsqlmysql4.dll
qsqlmysql4.lib
qsqlmysqld4.dll
qsqlmysqld4.lib.

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
"http://www.pikopong.com/blog/2010/04/11/how-to-enable-mysql-support-in-qt-sdk-for-windows/
 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 */ 
      ("QSQLITE", "QMYSQL3", "QMYSQL", "QODBC3", "QODBC")

Open in new window

arjoshi77Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

irfan_omairCommented:
can you try copying these files to Qt/bin folder and plugin folder
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
stachenovCommented:
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.
0
irfan_omairCommented:
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";

0
arjoshi77Author Commented:
thanks. I implemented all of your advisories and i am able to get output.
Thank you very much once again.
0
irfan_omairCommented:
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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.