PDA

View Full Version : [Release] problem with mysql, relaease build on another machine



kornicameister
29th September 2010, 17:45
Hey
I am having a big problem (maybe not so big :p), but it stops me from launching my application under another os (to be specific -> virtually installed Xp for testing before final release)
The bug of course does not affect my local release build
I copied all required dll's into {win}\system32 folder from C:\{qtdir}\qt\bin according to the tip from here (http://www.qtcentre.org/threads/28100-Build-release-and-run-error)
coppied dll's file :
- QtSql4.dll (as my application uses MySQL)
- QtCore4.dll
- QtGui4.dll
- mingwm10.dll
- libgcc_s_dw2-1.dll

and additionally, I've copied the following dlls (also from C:\{qtdir}\qt\bin) after bug occurred, but it did not solved the problem
- libmysql.dll
- qsqlmysql4.dll (build by me so as to be able to use mysql in qt programming, so it's not from above folder)

the error I get is on screenshot
http://wstaw.org/m/2010/09/29/error__JPG_300x300_q85.jpg (http://wstaw.org/h/8592d9c80db/)

I now have no idea how to fix this bug, so any kind of suggestion would be much more than helpful

Tomasz

Lykurg
29th September 2010, 18:32
In which folders you have put the files? Debug where Qt is searching for the libraries. Also make sure you have to right mysql.dll.

kornicameister
29th September 2010, 18:47
In which folders you have put the files? Debug where Qt is searching for the libraries. Also make sure you have to right mysql.dll.

here is the output from the installation script

[Files]
Source: "C:\Users\kornicameister\Documents\My Dropbox\Programming\Projects\C++\Agatom\AgatomProj ect-build-desktop\release\finish\AgatomProject.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\kornicameister\Documents\My Dropbox\Programming\Projects\C++\Agatom\AgatomProj ect-build-desktop\release\finish\dll2\*"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\kornicameister\Documents\My Dropbox\Programming\Projects\C++\Agatom\AgatomProj ect-build-desktop\release\finish\dll\*"; DestDir: "{win}\System32"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Users\kornicameister\Documents\My Dropbox\Programming\Projects\C++\Agatom\AgatomProj ect-build-desktop\release\finish\sources\*"; DestDir: "{app}\sources"; Flags: ignoreversion recursesubdirs createallsubdirs

now in folder dll are the files I've enumerated before and these files are copied into to

(disk_letter):\Windows\System32\
in folder dll2 are the files dragged from
~\qt\plugins\sqldrivers (this possible solution I found in another thread but it failed to help)
other files are irrelevant for this bug

I assume Qt searches for them in {win}\System32 dir, as without dll files (such as QtCore4.dll and others) the application used to failed to launch every time on the virtual machine

by right mysql.dll you mean what, to be exact ?

Lykurg
29th September 2010, 19:54
It seems you are not using the standard directories. See http://doc.qt.nokia.com/4.7/deployment-windows.html. Also what is QCoreApplication::libraryPaths() returning. Did Qt look on the "right" places and could find your plugins?
I put the mysql dll in the folder where my app is, and the plugin in a folder called sqldrivers.Try if that works for you.

kornicameister
29th September 2010, 20:03
I will try to follow Your advices and post the reply as soon as I can

kornicameister
5th October 2010, 12:31
I finally realized I've solved my problem when I'd seen this error
http://wstaw.org/m/2010/10/05/err_JPG_300x300_q85.jpg (http://wstaw.org/h/fc2be7c05e8/)

that means of course that mysql's driver has been successfully loaded and no 'Driver not loaded' error occurred to me this time

here is how I did it, according to the one of manuals Lykurg had sent
- created sqldrivers dir in the main dir of my application
- add library path, using suitable method from QApplication class, path must points at sqldrivers folder, not it's content

and that's it
I hope my joy is not premature :)
But everyting worked under control of client machine

One more question, does the client machine require MySQL Community Server configured as Client Machine ? I think I made myself quite clear at this point :)