[Qt-interest] mysql + qt4: compile errors on scooters example, from "c++ gui programming with qt 4"

S. Aguinaga sa_jr at yahoo.com
Fri Feb 27 22:27:39 CET 2009


I'm trying to compile the example "scooters" under Chapter 13 of the examples groups.  

I'm getting errors that read "undefined reference to `QSqlDatabase::..."  and I can't figure it out, other emails on the subject don't clearly 
answer the question.

I included the following in my make (i'm running on linux):

INCPATH       = -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtGui -I/usr/include -I. -I/usr/include/QtSql -I/usr/include/mysql -I. -I.

and the Qsqldatabase is located in two places:
/usr/include/QtSql/QSqlDatabase
/usr/local/Trolltech/Qt-4.4.3/include/QtSql/QSqlDatabase

if I change to the 2nd line in Makefile, I get the same errors.

I did enable the driver during the ./configure stage of the installation of "qt-x11"

Let me know.
// Sal 



________________________________
From: Bahadır Doğan <abahadirdogan at gmail.com>
To: qt-interest at trolltech.com
Sent: Monday, February 23, 2009 12:59:56 PM
Subject: [Qt-interest] compiling mysql plugin for windows

hello,
I'm trying to compile mysql plugin for windows. I follow this tutorial:
http://wiki.qtcentre.org/index.php?title=Building_the_QMYSQL_plugin_on_Windows_using_MinGW
my PATH environment variable is set to:
C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Qt\QtCreator\mingw\bin;C:\Qt\QtCreator\qt\bin
I created the liblibmysql.a as told in the tutorial.
Then I try to run this command in the /plugins/sqldrivers/mysql directory:

qmake -o Makefile
"INCLUDEPATH+=C:\Progra~1\MySQL\MySQLS~1.0\include"
"LIBS+=C:\Progra~1\MySQL\MySQLS~1.0\lib\opt\liblibmysql.a" mysql.pro

But I get an error saying:

C:\Progra~1\MySQL\MySQLS~1.0\include" "LIBS+=C:\Progra~1\MySQL\MySQLS~1.0\lib\op
t\liblibmysql.a" mysql.pro
Failure to read QMAKESPEC conf file c:/qt-greenhouse/Trolltech/Code_less_create_
more/Trolltech/Code_less_create_more/Troll/4.4.3/qt/mkspecs/win32-g++\qmake.conf
.
Error processing project file: mysql.pro


What is the problem?



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090227/9c5c18f1/attachment.html 


More information about the Qt-interest-old mailing list