I need to load the MySQL driver in Qt.
Windows XP
Qt 4.2.1
MySQL 5.0
This is the error message I get when trying to connect to the database:
"Driver not loaded Driver not loaded"
Please help !!!
Where can I find or download that driver ?
I need to load the MySQL driver in Qt.
Windows XP
Qt 4.2.1
MySQL 5.0
This is the error message I get when trying to connect to the database:
"Driver not loaded Driver not loaded"
Please help !!!
Where can I find or download that driver ?
Please, don't start multiple threads on the same problem. Also search the forum, because this topic was discussed several times.
http://doc.trolltech.com/4.2/sql-dri...l-4-and-higher
I followed the instructions in how to built the plugin, but it doesn't work. I get this:
collect2: ld returned 1 exit status
mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlmysql.dll] Error 1
mingw32-make[1]: Leaving directory `D:/qt-4.2.1/src/plugins/sqldrivers/mysql'
mingw32-make: *** [release] Error 2
I have tried to create the dumm plug-in, but it doesn't work.
Is it there a tutorial where someone explain in detail what to do ?
What is wrong !!! What ????
Please someone help !!!
I have reinstalled everything, including Windows. I have nothing else in my computer than the following:
Qt 4.2.2 and the Mingw that comes with it.
MySQL server 5.0.27.
I have registered the variables in the "Path", so when I type "make" or "qmake" in the console, then those commands are executed.
Then I did this:
cd %QTDIR%\src\plugins\sqldrivers\mysql
qmake -o Makefile "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MySQL\lib\opt\libmysql.lib" mysql.pro
make
The "qmake" command is successful, but the "make" command gives me this error:
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runt
ime-pseudo-reloc -Wl,-s -Wl,-s -shared -Wl,--out-implib,c:\qt\plugins\sqldrivers
\libqsqlmysql.a -o "..\..\..\..\plugins\sqldrivers\qsqlmysql.dll" tmp\obj\releas
e_shared\main.o tmp\obj\release_shared\qsql_mysql.o tmp\obj\release_shared\moc_q
sql_mysql.o -L"c:\qt\lib" -L"c:\qt\lib" C:\mysql\lib\opt\libmysql.lib -lQtSql4
-lQtCore4
Creating library file: c:\qt\plugins\sqldrivers\libqsqlmysql.a
tmp\obj\release_shared\qsql_mysql.o(.text+0x4c):qs ql_mysql.cpp: undefined refere
nce to `mysql_character_set_name@4'
tmp\obj\release_shared\qsql_mysql.o(.text+0x184):q sql_mysql.cpp: undefined refer
ence to `mysql_error@4'
tmp\obj\release_shared\qsql_mysql.o(.text+0x19a):q sql_mysql.cpp: undefined refer
ence to `mysql_errno@4'
tmp\obj\release_shared\qsql_mysql.o(.text+0x6d7):q sql_mysql.cpp: undefined refer
.
.
.
continues with a long list of errors until
.
.
.
tmp\obj\release_shared\qsql_mysql.o(.text+0x72ea): qsql_mysql.cpp: undefined refe
rence to `mysql_stmt_bind_param@8'
collect2: ld returned 1 exit status
make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlmysql.dll] Error 1
make[1]: Leaving directory `C:/qt/src/plugins/sqldrivers/mysql'
make: *** [release] Error 2
What in the world is wrong ?????
MinGW doesn't use .lib files. You have to create an import library from DLL.
http://mingw.org/mingwfaq.shtml#faq-msvcdll
I just don't get it !!!
Jacek, isn't there something simple... a command you know, so I have to avoid all that trouble ?
I am sure there should be a simple way to do it, a linking command or something !, perhaps a .dll that I can download ?
The exact commands you should run are in that FAQ entry.
Also read this:
http://www.qtcentre.org/forum/f-qt-p...dows-4048.html
Let me put it this way:
How do I configure Qt to work with MySQL ?
In Linux I could just type, I don't remember it exactly, something like:
./configure -static -plugin-sql-mysq -I /something/here/mysql.h -L /somathing/here/libmysqlclient
Afte "make" and the just mentioned command, I could use Qt with Mysql.
Now...now.... how is it done for Windows ? Should be as simple as that right ?
http://www.qtcentre.org/forum/f-inst...ighlight=mysql
Try that thread. It was the only way I got it to work.
Bookmarks