Driver not loaded Driver not loaded
I coding a program with Qt 4.8.4 and MySQL 5.5.(a non-install version mysql-5.5.29-win32)
I using mysql as my database driver. Now it able to work properly on my computer, but can not be run on other computers. It prompts "Driver not loaded Driver not loaded"
And I create a plugins file, including sqldrivers file(qsqlmysql4.dll) and codecs file(qcncodecs4.dll)
Well I copy the libgcc_s_dw2-1.dll, libmysql.dll, mingwm10.dll, QtCore4.dll, QtGui4.dll, QtSql4.dll to my program's file
Of course, my Qt supports "QSQLITE" "QMYSQL3" "QMYSQL" "QODBC3" "QODBC" drivers.
I need your help, please.
Re: Driver not loaded Driver not loaded
Hm, the error means normaly that libmysql.dll could not be found. So is libmysql.dll in the same directory as QtCore4.dll and also is libmysql.dll the library you used to build qsqlmysql4.dll?
Re: Driver not loaded Driver not loaded
Your qsqlmysql4.dll should be in 'Path_to_executable/sqldrivers/' folder for the program to run.
I had similar issue when putting it into 'Path_to_executable/plugins/sqldrivers/' folder.
Re: Driver not loaded Driver not loaded
I added this code:
Code:
app.addLibraryPath(strLibPath);
but there has the problem.
What should I do??
Re: Driver not loaded Driver not loaded
Quote:
Originally Posted by
Lykurg
Hm, the error means normaly that libmysql.dll could not be found. So is libmysql.dll in the same directory as QtCore4.dll and also is libmysql.dll the library you used to build qsqlmysql4.dll?
libmysql.dll is in MySQL's lib, and I copy to my program file.
libmysql.dll and qsqlmysql4.dll must copy to sqldrivers file??
And now libmysql.dll in the same directory as QtCore4.dll, but there also has the problem.
I don't know what you said.
Re: Driver not loaded Driver not loaded
Hi for me on windows 7 it works like this:
Driver not loaded means the sqldrivers folder cannot be located -> if i rename my sqldrivers folder i will get this error...
my folder/path structur:
libmysql.dll
urProgramm.exe
otherQtDlls.dll
sqldrivers\qsqlmysql4.dll
sqldrivers is a folder in the "exe" directory.
That mean put the "libmysql.dll to ur exe and other qtdll´s like qtguidll.... put the sqldrivers Folder in the path where ur exe is located.
I hope this helps you out of this.
Greets Anenja
Re: Driver not loaded Driver not loaded
Thanks.
just now I also use your advice to get access to load drivers, and it works well.
Thanks again.
Re: Driver not loaded Driver not loaded
Hyghen, where have you get that your programm supports "QSQLITE" "QMYSQL3" "QMYSQL" "QODBC3" "QODBC"? If it is on the "other" computer, then qsqlmysql4.dll is places correctly.
Have you tried to use Dependency Walker to see what library is actually missing?
Re: Driver not loaded Driver not loaded
Of course, I get them by my computers(Qt 4.8.4+MySQL 5.5).
And all problems is solved, the qslqmysql4.dll is in sqldrivers file, the libmysql.dll must be in the program file.
In other words, libmysql.dll copy to root directory of main_program_run.exe
Thanks your help.
Nice to you.