PDA

View Full Version : Installing SQL dirvers



MattPhillips
25th October 2010, 06:48
Hi,

I'm trying to install the SQL drivers on Windows 7, as per the instructions in the SQL Database Drivers help page. I'm using MinGW (I presume, since that's what Qt uses to build my programs) but when I'm in the qt directory and try to run mingw32-make or mingw32-make.exe from the command line, I get 'not recognized'. Same thing for nmake, and in that case the most recent version I could find (1.5) won't even install. And there is no option to compile SQL drivers when installing from the wizard. Can anyone give me a hand here? Thank you--

Matt

Lykurg
25th October 2010, 07:29
did you start the normal command line or the command line which comes with the SDK (it set up some paths that all needed programs are found.) Also have a look at our wiki where you find an article on how to install mysql with gcc.

MattPhillips
25th October 2010, 15:34
Thanks Lykurg,

I had been trying the normal command line and tried again with the Qt command line. It still didn't recognize nmake. I tried mingw32-make, which told me it couldn't find mysql.h; but when I supplied the path,

> mingw32-make -I"C:\Program Files\MySQL\MySQL Server 5.1\include"

it still couldn't see mysql.h. The path is right;

> dir "C:\Program Files\MySQL\MySQL Server 5.1\include\mysql.h"

lists the file.

Also I tried the Wiki but I only found a document on SQLite, which is already installed; I would really like to get MySQL.

Matt

MattPhillips
31st October 2010, 21:33
Followup--I tried to build mysql from within Qt, by opening mysql.pro. I added


INCLUDEPATH += "C:\Program Files\MySQL\MySQL Server 5.1\include"
LIBS += "C:\Program Files\MySQL\MySQL Server 5.1\lib\opt\libmysql.lib"

I ran qmake, clean, and then build, and got a list of undefined reference errors:


tmp/obj/debug_shared/qsql_mysql.o: In function `codec':

C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:223: undefined reference to `mysql_character_set_name@4'

tmp/obj/debug_shared/qsql_mysql.o: In function `qMakeError':
C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:234: undefined reference to `mysql_error@4'

C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:237: undefined reference to `mysql_errno@4'

tmp/obj/debug_shared/qsql_mysql.o: In function `qMakeStmtError':

C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:309: undefined reference to `mysql_stmt_error@4'

C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:312: undefined reference to `mysql_stmt_errno@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:358: undefined reference to `mysql_stmt_result_metadata@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:362: undefined reference to `mysql_num_fields@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:369: undefined reference to `mysql_fetch_field@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:432: undefined reference to `mysql_free_result@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:438: undefined reference to `mysql_store_result@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:440: undefined reference to `mysql_free_result@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:437: undefined reference to `mysql_next_result@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:446: undefined reference to `mysql_stmt_close@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:452: undefined reference to `mysql_free_result@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:496: undefined reference to `mysql_stmt_data_seek@12'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:498: undefined reference to `mysql_stmt_fetch@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:513: undefined reference to `mysql_data_seek@12'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:514: undefined reference to `mysql_fetch_row@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:529: undefined reference to `mysql_stmt_fetch@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:544: undefined reference to `mysql_fetch_row@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:565: undefined reference to `mysql_stmt_num_rows@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:570: undefined reference to `mysql_num_rows@4'

tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrive rs\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:614: undefined reference to `mysql_fetch_lengths@4'

... many more'

Anybody know what this is about? Thanks--

Matt

Lykurg
1st November 2010, 10:56
seems to be a problem with the spaces in the paths. Try quote() in the pro file.

MattPhillips
2nd November 2010, 14:14
Hi Lykurg,

So I tried this


INCLUDEPATH += $$quote(C:\Program Files\MySQL\MySQL Server 5.1\include)
LIBS += $$quote(C:\Program Files\MySQL\MySQL Server 5.1\lib\opt\libmysql.lib)

And got exactly the same thing.

Matt