SQL Driver not loaded in Release
Hi, I'm having a problem with a SQL driver.
The Sql connection is not done on Release but it connects on Debug.
The exe dir contains the Qt debug and release libs and I have the "sqldrivers" dir with the debug and release libs inside.
The connection returns me "Driver not Loaded".
Thanks,
Re: SQL Driver not loaded in Release
are you sure that yours application (release) don't use debug libs?
check dependency of application.
Re: SQL Driver not loaded in Release
Hi,
The application dir contains the debug and release libs.
I checked with "Dependency Walker" and the dir contains the needed libs.
I have a computer that has the MySQL database and another computer that is the client. I have the application in the client computer. If I exec the application on the client, I get "Driver Not Loaded" error, but If I share the app dir and I exec the application from the server computer(using the shared dir), it works.
The server computer is the developer computer.
Thanks,
Re: SQL Driver not loaded in Release
do you use sql-plugins? if yes, then try to copy QTDIR/plugins/sqldrivers dir to yours app directory.
Re: SQL Driver not loaded in Release
Hi,
I did it as I told you in the first post.
Thanks,
Re: SQL Driver not loaded in Release
so, you application dir has next structure
Quote:
appdir
|----sqldrivers
| |---- qsqlmysql4.dll
| |-----qsqlmysql4d.dll
|----myapp.exe
right?
Re: SQL Driver not loaded in Release
Hi,
Yes, in appdir also there are the Qt4 libs
Re: SQL Driver not loaded in Release
And the MySQL DLL is in PATH?
Re: SQL Driver not loaded in Release
Hi,
Yes, the MySQL is in the Path. AI have also tryied to copy the MySQL release DLL into the appDir and the release app gets the same error and the debug app is connecting well.
Thanks,
Re: SQL Driver not loaded in Release
Hi,
I have one question that I don't really understand.
The Envoirment variable "LIB" points to "%MYSQL%\lib\debug".
When Qt is compiled, the MySQL debug driver is linked on debug lib and MySQL release driver is linked on release lib?
So when I try to start the application and the Qt MySQL drivers are linked to the debug MySQL lib, the Qt driver don't find the correct MySQL lib.
Thanks,
Re: SQL Driver not loaded in Release
use path for LIB variable
Quote:
LIB=%MYSQL%\lib\opt;
Re: SQL Driver not loaded in Release
Hi,
Yes, it's what I was thinking.
So, the opt lib will be linked when compiling the app.
Thank you very much,
Another question to Visual Studio users: How can I force to link with different libs? As opt MySQL lib for release and debug MySQL lib for debug?
Thanks,
Re: SQL Driver not loaded in Release
try to add needed library manually.
e.g. go to "Project->%1 Properties" (%1 your project name), then go to "Linker->Input" and add in "Additional Dependecies" neede library.
Re: SQL Driver not loaded in Release
Hi,
Fine.
Thank you very much again.
;)
Re: SQL Driver not loaded in Release
Thanks!
It worked for me!