I have problems with QMYSQL Driver!
-
Yes I did. I crated the libmysql.a
-
@kallo here are the steps to build mysql plug-in driver ( and I assure you it works :-) ):
- download mysql-connector-c-noinstall-6.0.2-win32 binary package from mysql downloads.
- open %QTDIR%\src\plugins\sqldrivers\mysql\mysql.pro in QtCreator
- add LIBS and INCLUDEPATH in mysql.pro to match with your mysql-connector-c-noinstall-6.0.2-win32 path
- after mysql.pro is succesfully build, copy the qsqlmysqld4.dll + qsqlmysql4.dll in %QTDIR%\Desktop...etc...\plugins\sqldrivers (there should already be qsqlite4.dll)
- copy libmysql.dll in %QTDIR%\Desktop...etc...\bin
that's all
-
No cincirin, that is not all. It depends on your toolchain. If you use minGw, as kaloo is doing, you need some additional steps.
-
I use mingw toolchain and they work.
-
So I did how cincirin said
!http://img51.imageshack.us/img51/5876/unledcj.png!the output says
@
cannot find -libmysql
@Where should libmysql stay? or what I did wrong?
-
Do you have libmysql*.a* ? Don't you have libmysql.lib ?
Also you have to put only the path to libmysql.lib LIBS += yourPath -
I have libmysql.a
-
From what I see, you didn't download mysql conector binary builds. Your path is towards xampp/...
-
I have mysql-connector-c-noinstall-6.0.2-win32, extracted in the xampp/mysql folder
edit:
if I put
@
INCLUDEPATH += C:/xampp/mysql/include
LIBS += C:/xampp/mysql/lib/libmysql.a@
before
@
include(../../../sql/drivers/mysql/qsql_mysql.pri)
include(../qsqldriverbase.pri)
@
The output gives me 83 errors with undefined reference -
Ok, then your project should look as: ... LIBS += c:/xampp/mysql/lib
Anyway, I don't have libmysql*.a* -
I created the libmysql.a with
@ reimp C:/xampp/mysql/lib/libmysql.lib @ -
You have to put only the path to mysql lib directory, because qsql_mysql.pri already do: LIBS += -llibmysql
Did you try with LIBS += -Lc:/xampp/mysql/lib ? -
the mysql.pro is now:
@
TARGET = qsqlmysqlSOURCES = main.cpp
INCLUDEPATH += C:/xampp/mysql/include
LIBS += C:/xampp/mysql/libinclude(../../../sql/drivers/mysql/qsql_mysql.pri)
include(../qsqldriverbase.pri)
@and the output sais
@
C:/xampp/mysql/lib No such file: Permission Denied
@but the folder is not read only... I don`t know what to do...
-
Your project should be:
@
TARGET = qsqlmysqlSOURCES = main.cpp
include(../../../sql/drivers/mysql/qsql_mysql.pri)include(../qsqldriverbase.pri)
INCLUDEPATH = C:/xampp/mysql/include
LIBS += -LC:/xampp/mysql/lib
@ -
Yes, now is
@
TARGET = qsqlmysqlSOURCES = main.cpp
include(../../../sql/drivers/mysql/qsql_mysql.pri)include(../qsqldriverbase.pri)
INCLUDEPATH = C:/xampp/mysql/include
LIBS += -LC:/xampp/mysql/lib
@
but again
@
cannot find -libmysql
@Where should be that file? in the lib folder of mysql?
-
Yes, libmysql .lib lives in mysql lib directory. You don't have to convert it.
-
In which directory exactly do you try to build the plugin? When looking at your screenshot from below it looks like you try to build it in qtVersion/plugins/sqldrivers/mysql. Is this the case? The directory where you should be building it is not the one in your screenshot, instead you should build it in:
qtVersion/src/plugins/sqldrivers/mysql
[quote author="kaloo" date="1307298523"]Where I did wrong?
!http://img641.imageshack.us/img641/1700/unledvfc.png!I can`t find
- libqsqlmysql4.a
- libqsqlmysqld4.a
- qsqlmysql4.dll
- qsqlmysqld4.dll
[/quote]
-
sigrid I know that now, but that is one of the old errors. Not I have problems with
[quote]
Yes, now is
@
TARGET = qsqlmysqlSOURCES = main.cpp
include(../../../sql/drivers/mysql/qsql_mysql.pri)include(../qsqldriverbase.pri)
INCLUDEPATH = C:/xampp/mysql/include
LIBS += -LC:/xampp/mysql/lib
@
but again
@
cannot find -libmysql
@
Where should be that file? in the lib folder of mysql?
[/quote]