[Qt-interest] configuring Qt with MySQL

Vincent L. Damewood lists at damewood.us
Fri May 15 03:49:08 CEST 2009


On Wed, May 13, 2009 at 3:11 PM, Ashish Singh <asinghmlists at gmail.com> wrote:
> Hi Vincent, My mistake..what I wanted to say was that ' libmysql.dll' is in
> the same location as '..MySQLServer5.1/lib/opt'. Actually both
> 'libmysql.lib' and 'libmysql.dll' are at the same location.
>

This changes nothing. Your application needs to use libmysql.dll to
communicate with a server. Therefore, you will need the libmysql.dll
file in a place where your application can find it. The fact that it's
in the same directory as the corresponding .lib file *DOES* *NOT*
*MATTER*. Your application is not going to look there. Your
application is going to look in the same directory it's in, some
system directories, and the directories in your PATH environment
variable. If you use the PATH variable, you will be assuming an
environment that users of your application probably will not have, and
therefore, any applications you write with this set up will break on
other people's systems. If you copy the DLL file to a system
directory, you will start the process for DLL Hell. So, in order not
to depend on PATH, or cause DLL Hell, you will have to copy the DLL to
the same directory as your application.

Here's a document explaining the DLL search order.
http://msdn.microsoft.com/en-us/library/ms682586.aspx

> Isn't there a way to have this automatically taken care of instead of
> copying the 'libmysql.dll' in the executable directory everytime?

Get Visual Studio to do it for you.



More information about the Qt-interest-old mailing list