Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, January 2007
Driver not loaded when deploying app

Pages: Prev | 1 | 2 | Next

Message 1 in thread

Hi list,

on my development desktop an application which connects to a database
works perfectly fine, but after deploying it i get ther error "Driver
not loaded". I just depends.exe on windows to figure out the
dependencies and deployed all of the files as well, but nevertheless the
error occurs.

I really appreciate any help!
Chris
-- 
 [ signature omitted ] 

Message 2 in thread

Christian Rengstl schrieb:
> Hi list,
> 
> on my development desktop an application which connects to a database
> works perfectly fine, but after deploying it i get ther error "Driver
> not loaded". I just depends.exe on windows to figure out the
> dependencies and deployed all of the files as well, but nevertheless the
> error occurs.
> 
> I really appreciate any help!
> Chris

Hi Chris,

you have to ensure that plugin is located in 
<applicationpath>/plugins/sqldrivers/.

Regards,
Thomas

--
 [ signature omitted ] 

Message 3 in thread

Hi Thomas,

thanks for your quick answer. Unfortunately, after copying all *.dll
files to myApp\plugins\sqldrivers i still get the error. Do i have to
specify something like an environment variable maybe?

Thomas DÃhling <t.daehling@xxxxxxxxxxxxxx> schrieb am Do, Jan wrote on
25, 2007 um 12:13
> pm in Nachricht <45B890E4.9020202@xxxxxxxxxxxxxx>:
>> Christian Rengstl schrieb:
>>> Hi list,
>>> 
>>> on my development desktop an application which connects to a
database
>>> works perfectly fine, but after deploying it i get ther error
"Driver
>>> not loaded". I just depends.exe on windows to figure out the
>>> dependencies and deployed all of the files as well, but
nevertheless the
>>> error occurs.
>>> 
>>> I really appreciate any help!
>>> Chris
>> 
>> Hi Chris,
>> 
>> you have to ensure that plugin is located in 
>> <applicationpath>/plugins/sqldrivers/.
>> 
>> Regards,
>> Thomas
>> 
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx
with 
>> "unsubscribe" in the subject or the body.
>> List archive and information:
http://lists.trolltech.com/qt-interest/

-- 
 [ signature omitted ] 

Message 4 in thread

*Only* the qsqlmysql.dll should go into that directory, the rest should 
stay in the place where your executable is.

Christian Rengstl schrieb:
> Hi Thomas,
> 
> thanks for your quick answer. Unfortunately, after copying all *.dll
> files to myApp\plugins\sqldrivers i still get the error. Do i have to
> specify something like an environment variable maybe?
> 
> Thomas DÃhling <t.daehling@xxxxxxxxxxxxxx> schrieb am Do, Jan wrote on
> 25, 2007 um 12:13
>> pm in Nachricht <45B890E4.9020202@xxxxxxxxxxxxxx>:
>>> Christian Rengstl schrieb:
>>>> Hi list,
>>>>
>>>> on my development desktop an application which connects to a
> database
>>>> works perfectly fine, but after deploying it i get ther error
> "Driver
>>>> not loaded". I just depends.exe on windows to figure out the
>>>> dependencies and deployed all of the files as well, but
> nevertheless the
>>>> error occurs.
>>>>
>>>> I really appreciate any help!
>>>> Chris
>>> Hi Chris,
>>>
>>> you have to ensure that plugin is located in 
>>> <applicationpath>/plugins/sqldrivers/.
>>>
>>> Regards,
>>> Thomas
>>>
>>> --
>>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx
> with 
>>> "unsubscribe" in the subject or the body.
>>> List archive and information:
> http://lists.trolltech.com/qt-interest/
> 

--
 [ signature omitted ] 

Message 5 in thread

With all *.dll files i actually meant all sqldrivers that were
available. I did that only after it didn't work with only the dll for
psql. Sorry about that...

-- 
 [ signature omitted ] 

Message 6 in thread

Ok, in short:

- ensure that your qt and the qsqlpsql plugin have the same buildkey (if 
you don't know what it is, you probably haven't used one anyway, so you 
can skip this)
- check if qsqlpsql.dll is placed in <appdir>/plugins/sqldrivers/
- check if all libraries that qsqlpsql are placed in <appdir>/ (this 
inlcudes libpq.dll and its dependencies, like libiconv-2.dll and so on)

Then it should work. I can only imagine that you missed to add a 
required library to the correct directory.

Christian Rengstl schrieb:
> With all *.dll files i actually meant all sqldrivers that were
> available. I did that only after it didn't work with only the dll for
> psql. Sorry about that...
> 

--
 [ signature omitted ] 

Message 7 in thread

On Thursday 25 January 2007 12:44, Thomas DÃhling wrote:

Hi,

I had something similar and stumbled across a post which suggested 

<appdir>/sqldrivers rather than <appdir>/plugins/sqldrivers

That fixed it for me with Qt4.2.1, sqlite on Windows 2000

A


> Ok, in short:
>
> - ensure that your qt and the qsqlpsql plugin have the same buildkey (if
> you don't know what it is, you probably haven't used one anyway, so you
> can skip this)
> - check if qsqlpsql.dll is placed in <appdir>/plugins/sqldrivers/
> - check if all libraries that qsqlpsql are placed in <appdir>/ (this
> inlcudes libpq.dll and its dependencies, like libiconv-2.dll and so on)
>
> Then it should work. I can only imagine that you missed to add a
> required library to the correct directory.
>
> Christian Rengstl schrieb:
> > With all *.dll files i actually meant all sqldrivers that were
> > available. I did that only after it didn't work with only the dll for
> > psql. Sorry about that...
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body. List archive and information:
> http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ] 

Message 8 in thread

Unfortunately, i still get the same results :-(

amit <pom2@xxxxxxxxxxxxxxxx> schrieb am Do, Jan 25, wrote on 2007 um 
2:15 pm in
> Nachricht <200701251315.22523.pom2@xxxxxxxxxxxxxxxx>:
>> On Thursday 25 January 2007 12:44, Thomas DÃhling wrote:
>> 
>> Hi,
>> 
>> I had something similar and stumbled across a post which suggested 
>> 
>> <appdir>/sqldrivers rather than <appdir>/plugins/sqldrivers
>> 
>> That fixed it for me with Qt4.2.1, sqlite on Windows 2000
>> 
>> A
>> 
>> 
>>> Ok, in short:
>>>
>>> - ensure that your qt and the qsqlpsql plugin have the same
buildkey (if
>>> you don't know what it is, you probably haven't used one anyway, so
you
>>> can skip this)
>>> - check if qsqlpsql.dll is placed in <appdir>/plugins/sqldrivers/
>>> - check if all libraries that qsqlpsql are placed in <appdir>/
(this
>>> inlcudes libpq.dll and its dependencies, like libiconv-2.dll and so
on)
>>>
>>> Then it should work. I can only imagine that you missed to add a
>>> required library to the correct directory.
>>>
>>> Christian Rengstl schrieb:
>>> > With all *.dll files i actually meant all sqldrivers that were
>>> > available. I did that only after it didn't work with only the dll
for
>>> > psql. Sorry about that...
>>>
>>> --
>>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx
with
>>> "unsubscribe" in the subject or the body. List archive and
information:
>>> http://lists.trolltech.com/qt-interest/ 
>> 
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx
with 
>> "unsubscribe" in the subject or the body.
>> List archive and information:
http://lists.trolltech.com/qt-interest/

-- 
 [ signature omitted ] 

Message 9 in thread

amit schrieb:
> On Thursday 25 January 2007 12:44, Thomas DÃhling wrote:
> 
> Hi,
> 
> I had something similar and stumbled across a post which suggested 
> 
> <appdir>/sqldrivers rather than <appdir>/plugins/sqldrivers
> 
> That fixed it for me with Qt4.2.1, sqlite on Windows 2000

Hello all,

just read and understand the following documentation:

 http://doc.trolltech.com/4.2/plugins-howto.html

Among the lines you will find the solution to all your plugin deployment
problems (it's actually on the top part of the documentation):

"But where is the plugins directory? When the application is run, Qt
will first treat the application's executable directory as the
pluginsbase. For example if the application is in C:\Program Files\MyApp
and has a style plugin, Qt will look in C:\Program Files\MyApp\styles.
[...]"

And so on. There you also find how to add additional plugin paths.

So yes, <appdir>/sqldrivers is not just a suggestion, it's even
documented in ... the Qt documentation!

(yes, sometimes it's definitively worth reading the docs ;)


Cheers, Oliver

--
 [ signature omitted ] 

Message 10 in thread

On Thursday 25 January 2007 13:30, Till Oliver Knoll wrote:
> (yes, sometimes it's definitively worth reading the docs ;)

Agreed! 

But you sometimes have to read quite carefully and first you have to find the 
right bit.  I can't recall where now, but I got the mistaken idea of using 
<appdir>/plugins/sqldrivers from........the docs :-)

A

--
 [ signature omitted ] 

Message 11 in thread

amit schrieb:
> On Thursday 25 January 2007 13:30, Till Oliver Knoll wrote:
>> (yes, sometimes it's definitively worth reading the docs ;)
> 
> Agreed! 
> 
> But you sometimes have to read quite carefully and first you have to find the 
> right bit.  I can't recall where now, but I got the mistaken idea of using 
> <appdir>/plugins/sqldrivers from........the docs :-)

Agreed :) Sometimes I also confuse the paths, and I also set it to
[appdir]/plugins/styles, for example.

But I just checked the docs, even back at Qt 3.3.7 times it says
[appdir]/styles.

But below it sais:

"The default directory for plugins is QTDIR/plugins, with each type of
plugin in a subdirectory for that type, e.g. styles."

Only with regards to $QTDIR comes the "plugins" directory into play.
Maybe that's where the confusion comes form ;)

Also I find the following documentation quite useful:

  http://doc.trolltech.com/4.2/deployment.html

It also has some (small) references to deploying plugins.

Cheers, Oliver

--
 [ signature omitted ] 

Message 12 in thread

Hi,

> But you sometimes have to read quite carefully and first you have to find the 
> right bit.  I can't recall where now, but I got the mistaken idea of using 

This specific piece of information is in the paragraph about plugins:

	How to Create Qt Plugins
	http://doc.trolltech.com/4.2/plugins-howto.html

This paragraph is linked to from:

	The index page
	http://doc.trolltech.com/4.2/
	Plugin System

	Deploying Qt Applications
	http://doc.trolltech.com/4.2/deployment.html
	In particular you will need to deploy Qt plugins, like for
	example JPEG support or SQL drivers. For more information
	about plugins, see the How to Create Qt Plugins documentation.

Where else would you like to find this information? Maybe an additional 
link could be added somewhere else.

> <appdir>/plugins/sqldrivers from........the docs :-)

I'm unable to find anything like that by grep'ing through the Qt 4 docs. 
Where would you have seen that?

--
 [ signature omitted ] 

Message 13 in thread

....I think I probably saw it in my head, late one evening :-)  Docs are clear 
if you read ** carefully **.  But nothing is clear if you are confused 
yourself!

I think I probably got distracted by the extracts talking about building 
plugins from source.

At....

http://doc.trolltech.com/4.2/plugins-howto.html#the-higher-level-api-writing-qt-extensions

I get this....

The default directory for plugins is QTDIR/plugins (where QTDIR is the 
directory where Qt is installed), with each type of plugin in a subdirectory 
for that type, e.g. styles. 

Further up the same page I get....

QSqlDriverPlugin  plugins/sqldrivers  Case Sensitive

Put the two together in a confused state and bingo!

I'm not complaining....I should take a walk when I'm not thinking straight.

On Thursday 25 January 2007 20:30, Dimitri wrote:
>
> I'm unable to find anything like that by grep'ing through the Qt 4 docs.
> Where would you have seen that?
>
> --
> Dimitri Papadopoulos

--
 [ signature omitted ] 

Message 14 in thread

Now i put all libraries, altogether 7, incl. the dependencies of the
dependencies in the appdir together with the qt-dll files and the
executable. The sqldriver-dll files are in appdir/plugins/sqldrivers,
but still the same error.

Thomas DÃhling <t.daehling@xxxxxxxxxxxxxx> schrieb am Do, Jan wrote on
25, 2007 um  1:44
> pm in Nachricht <45B8A630.9070303@xxxxxxxxxxxxxx>:
>> Ok, in short:
>> 
>> - ensure that your qt and the qsqlpsql plugin have the same buildkey
(if 
>> you don't know what it is, you probably haven't used one anyway, so
you 
>> can skip this)
>> - check if qsqlpsql.dll is placed in <appdir>/plugins/sqldrivers/
>> - check if all libraries that qsqlpsql are placed in <appdir>/ (this

>> inlcudes libpq.dll and its dependencies, like libiconv-2.dll and so
on)
>> 
>> Then it should work. I can only imagine that you missed to add a 
>> required library to the correct directory.
>> 
>> Christian Rengstl schrieb:
>>> With all *.dll files i actually meant all sqldrivers that were
>>> available. I did that only after it didn't work with only the dll
for
>>> psql. Sorry about that...
>>> 
>> 
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx
with 
>> "unsubscribe" in the subject or the body.
>> List archive and information:
http://lists.trolltech.com/qt-interest/

-- 
 [ signature omitted ] 

Message 15 in thread

"Christian Rengstl" <Christian.Rengstl@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in 
message news:45B8BC01.90AD.0080.0@xxxxxxxxxxxxxxxxxxxxxxxxxxx
> Now i put all libraries, altogether 7, incl. the dependencies of the
> dependencies in the appdir together with the qt-dll files and the
> executable. The sqldriver-dll files are in appdir/plugins/sqldrivers,
> but still the same error.

The SQL driver DLL files should be in  appdir/sqldrivers. All DLLs that 
depends lists for the application binary, or for any plugin DLL you want 
to use, have to be in appdir directly. i.e.


c:\appdir\app.exe
c:\appdir\QtCore4.dll
c:\appdir\QtSql4.dll
c:\appdir\libpq.dll
c:\appdir\msvcr80.dll
[and others]
c:\appdir\sqldrivers\qsqlpsql.dll


Volker


> Thomas Dähling <t.daehling@xxxxxxxxxxxxxx> schrieb am Do, Jan wrote on
> 25, 2007 um  1:44
>> pm in Nachricht <45B8A630.9070303@xxxxxxxxxxxxxx>:
>>> Ok, in short:
>>>
>>> - ensure that your qt and the qsqlpsql plugin have the same buildkey
> (if
>>> you don't know what it is, you probably haven't used one anyway, so
> you
>>> can skip this)
>>> - check if qsqlpsql.dll is placed in <appdir>/plugins/sqldrivers/
>>> - check if all libraries that qsqlpsql are placed in <appdir>/ (this
>
>>> inlcudes libpq.dll and its dependencies, like libiconv-2.dll and so
> on)
>>>
>>> Then it should work. I can only imagine that you missed to add a
>>> required library to the correct directory.
>>>
>>> Christian Rengstl schrieb:
>>>> With all *.dll files i actually meant all sqldrivers that were
>>>> available. I did that only after it didn't work with only the dll
> for
>>>> psql. Sorry about that...
>>>>
>>>
>>> --
>>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx
> with
>>> "unsubscribe" in the subject or the body.
>>> List archive and information:
> http://lists.trolltech.com/qt-interest/
>
> -- 
>
> --
> Christian Rengstl M.A.
> Klinik und Poliklinik für Innere Medizin II
> Kardiologie - Forschung
> Universitätsklinikum Regensburg
> B3 1.388
> Franz-Josef-Strauss-Allee 11
> 93053 Regensburg
> Tel.: +49-941-944-7230
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/ 


--
 [ signature omitted ] 

Pages: Prev | 1 | 2 | Next