Re: QMYSQL driver not loaded
http://www.qtcentre.org/forum/faq.ph...lugin_category
[wiki]Building the QMYSQL plugin on Windows using MinGW[/wiki]
Re: QMYSQL driver not loaded
Quote:
Originally Posted by
wysota
I have no idea why keep getting the "undefined reference " such as following:
Code:
C:/Qt/4.4.3/src/corelib/plugin/quuid.cpp:566: undefined reference to `CoCreateGu
id@4'
./tmp\obj\debug_shared\qeventdispatcher_win.o(.text+0x2ac5): In function `ZN28QE
ventDispatcherWin32Private16doWsaAsyncSelectEi':
C:/Qt/4.4.3/src/corelib/kernel/qeventdispatcher_win.cpp:619: undefined reference
to `WSAAsyncSelect@16'
the last thing i tried was calling mingw32-make after following instructions at "MinGW tips"
section of:
http://wiki.qtcentre.org/index.php?t...ws_using_MinGW
i'm stuck!:confused:
Re: QMYSQL driver not loaded
What exactly step by step did you do? Please include details such as names of archives you downloaded and info about your environment.
Re: QMYSQL driver not loaded
i installed mysql in c:\mysql,
include files are installed and are located in C:\MYSQL\include
lib files are in C:\MYSQL\lib\opt
i didn't have reimp utility so i downloaded it from sourceforge and put it in bin directory of mingw(later i put it in qt bin directory too)
then I did
then cd into C:\Qt\4.4.3\src\plugins\sqldrivers\mysql and then i run
Code:
qmake -o Makefile "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MySQL\lib\opt\liblibmysql.a" mysql.pro
and while i'm in C:\Qt\4.4.3\src\plugins\sqldrivers\mysql directory i run make command
some stuff go well at first but i get these undefined reference erros
Code:
tmp/obj/debug_shared/moc_qsql_mysql.o(.rdata$_ZTV12QMYSQLDriver[vtable for QMYSQ
LDriver]+0x7c):c:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4
.2
/bits
/locale_facets.
tcc:2502: undefined reference to `
QSqlDriver::setLastError
what could be wrong?couldn't this be a version conflict of mingw,qt or mysql?
i have to get mysql driver running,what else can i do? any other solutions?
--
thanks again
Re: QMYSQL driver not loaded
I would try running configure with options to enable mysql support and then cd into the directory containing the plugin and run make there. There might have been some changes in Qt that modified the way plugins are build and those instructions might be wrong.
Re: QMYSQL driver not loaded
Quote:
Originally Posted by
wysota
I would try running configure with options to enable mysql support and then cd into the directory containing the plugin and run make there. There might have been some changes in Qt that modified the way plugins are build and those instructions might be wrong.
i did that,the same errors cameup,:(
Re: QMYSQL driver not loaded
are you sure that this file name is correct 'liblibmysql.a'? maybe 'libmysql.a'?
Re: QMYSQL driver not loaded
Quote:
Originally Posted by
spirit
are you sure that this file name is correct 'liblibmysql.a'? maybe 'libmysql.a'?
yes I'm sure it's liblibmysql.a,i checked it
Re: QMYSQL driver not loaded
It really should be libmysql.a...
Re: QMYSQL driver not loaded
there was just a versioning issue and the problem got fixed by upgrading mysql server and I could make those mysql drivers DLLs ,now is there anything other than DLL files that I should ship ? because I get the same error on other machines trying to execute my program despite of having the DLLs
Re: QMYSQL driver not loaded
You should ship the Qt MySQL driver (qmysql.dll) and MySQL client library (mysqlclient.dll or mysql.dll or something like that). The driver has to be placed in the sqldrivers subdirectory of your application's installation directory and MySQL library either in the installation directory or in a system directory (like C:\Windows\System32).
Re: QMYSQL driver not loaded
Quote:
Originally Posted by
wysota
You should ship the Qt MySQL driver (qmysql.dll) and MySQL client library (mysqlclient.dll or mysql.dll or something like that). The driver has to be placed in the sqldrivers subdirectory of your application's installation directory and MySQL library either in the installation directory or in a system directory (like C:\Windows\System32).
from QT docs
Quote:
Plugins work differently to normal DLLs, so we can't just copy them into the same directory as our application's executable as we did with the Qt DLLs. When looking for plugins, the application searches in a plugins subdirectory inside the directory of the application executable.
So to make the plugins available to our application, we have to create the plugins subdirectory and copy over the relevant DLLs:
plugins\pnp_basictools.dll
plugins\pnp_extrafilters.dll
it was not mentioned that sql drivers DLL files should be put in a subdirectory called sqldrivers within plugins directory,thanks wysota