[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

mysql plugin for QT

Posted on 2011-10-16
5
Medium Priority
?
442 Views
Last Modified: 2012-06-27
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

0
Comment
Question by:arjoshi77
  • 3
5 Comments
 
LVL 7

Accepted Solution

by:
irfan_omair earned 1332 total points
ID: 36976077
can you try copying these files to Qt/bin folder and plugin folder
0
 
LVL 4

Assisted Solution

by:stachenov
stachenov earned 668 total points
ID: 36976204
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
 
LVL 7

Assisted Solution

by:irfan_omair
irfan_omair earned 1332 total points
ID: 36976343
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
 

Author Closing Comment

by:arjoshi77
ID: 36977862
thanks. I implemented all of your advisories and i am able to get output.
Thank you very much once again.
0
 
LVL 7

Expert Comment

by:irfan_omair
ID: 36977896
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
In this article, we’ll look at how to deploy ProxySQL.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

872 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