PDA

View Full Version : Unclear path



mongenix
7th January 2007, 03:54
For windows Qt and a mysql driver, what vars should be set and with what

using: #include <QSqlDatabase>

during 'make' I get an error: main.cpp:5:24: QSqlDatabase: No such file or directory

qsqldatabase.h file lives in C:\Qt\4.1.1\include\Qt

Thanks

e8johan
7th January 2007, 09:11
Have you added QT += sql to your project file?

mongenix
7th January 2007, 16:13
The short answer is:
No. Did not know I needed to.
I am assuming that by project file you mean test1.pro file.
I added sql to the QT var and ran qmake test1.pro <no errors>
I then ran 'make' < no errors.
Thank you - that seemed to fix my error problems

The long answer is:
I am so new to this that the first question that came to mind when I read your post is "What is a project file?"

Is there a good tutorial for absolute beginners like me?

I purchased the only 2 books I could find on Qt4 and have read on line posts for months (on and off) to try and get Qt4 installed with MySql drivers and create a "SIMPLE" program to test it.
While these books are good, they leave out basic foundation information that I need.
Therefore, I have been unsuccessful.
I am not new to programming but I am new to C++ at this level. I have written programs in Visual C++ and Borland C++ Builder using MySql databases, but they take care of nearly all compiling and linking for you. You install the IDE, you create the program and off you go. The path and vars are already set for you.
There must be a step-by-step guide somewhere to help install and configure Qt and then create, compile and link a very simple program to access a very simple table in MySql or other database. I just cannot find it. Once I get the basics, I can run with it from there but the basics are a mystery to me.

Thank you for your reply