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

Qt-interest Archive, April 2008
Qt 4.3.2 - Unable to load MySQL plugin on Win32


Message 1 in thread

1. I'm using Qt the 4.3.2 opensource package and have built
it with VSC++ 2005 Express edition.

2. The following program:

> int main (int argc, char *argv[])
> {
>     QCoreApplication qapp(argc, argv);       
>     qDebug() << QSqlDatabase::drivers();
> }   

emits the following when run with QT_DEBUG_PLUGINS=1:

> QFactoryLoader::QFactoryLoader() looking at "E:/qt/qt-win-opensource-src-4.3.2/plugins/sqldrivers/qsqlited4.dll" 
> keys ("QSQLITE") 
> 
> QFactoryLoader::QFactoryLoader() looking at "E:/qt/qt-win-opensource-src-4.3.2/plugins/sqldrivers/qsqlmysqld4.dll" 
> "The file 'E:/qt/qt-win-opensource-src-4.3.2/plugins/sqldrivers/qsqlmysqld4.dll' is not a valid Qt plugin." 
>          not a plugin 

3. I've compiled the plugins both with and without

CONFIG -= embed_manifest_dll

in src/plugins/sqldrivers/mysql/mysql.pro. The results
are the same with each build.

4. I've taken a look at qsqlmysqld4.dll with the Windows dependency
walker tool, and AFAICS, it finds all required modules in the dependency
tree correctly (in particular, it finds the mysql.dll dependency), and
the symbols exported (2 of them) are identical to those in the SQLITE
driver, which is loaded fine.

5. I've debugged QSqlDatabase::drivers() to the point where I can
see that the code in QLibraryPrivate::isPlugin(), line 586 is the
culprit:

>  573     QString regkey = QString::fromLatin1("Qt Plugin Cache %1.%2.%3/%4")
>  574                      .arg((QT_VERSION & 0xff0000) >> 16)
>  575                      .arg((QT_VERSION & 0xff00) >> 8)
>  576                      .arg(QLIBRARY_AS_DEBUG ? QLatin1String("debug") : QLatin1String("false"))
>  577                      .arg(fileName);
>  578     QStringList reg;
>  579 
>  580     QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
>  581     reg = settings.value(regkey).toStringList();
>  582     if (reg.count() == 4 && lastModified == reg.at(3)) {
>  583         qt_version = reg.at(0).toUInt(0, 16);
>  584         debug = bool(reg.at(1).toInt());
>  585         key = reg.at(2).toLatin1();
>  586         success = qt_version != 0;
>  587     } else {

In my case, qt_version is 0 which is the point at which isPlugin()
gives up. This is something to do with the plugin cache, which I don't
understand fully; however, I get the impression that the plugin loader
has tried previously (when ?) to load the plugin and cached someinfo
about its failure in QSettings, so I'm no further forward in finding the
root cause of the failure to load.

So:

1) does anyone have any idea as to what I've screwed up ?
(I'm currently leaning towards the subtle-bug-in-Qt/VSC++
option, but I'm willing to be convinced otherwise)

2) is there anything more I can do to track this problem down ?
I'm currently stumped. I've found a single reference to
QT_DEBUG_COMPONENTS in Qt Assistant but I'm not sure what that's
for - should I be rebuilding everything with this defined, and
trying again ?

-- 
 [ signature omitted ] 

Message 2 in thread

qtabwidget with vertical tabs
this feature is registered as suggestion on task tracker with ID186458.

http://trolltech.com/customer/task-tracker/index_html?id=186458&method=entry


this link offer possibility ONLY for customers (commercial qt licence 
owners?...) to vote.
this vote help Trolltech to take decision about doing or not or later a 
suggested feature.
Don't know if today there is a public access to vote (it was planed by 
trolls...)

so, customers if you're interested by vertical tab widgets, like this
http://www.nuos.edu.ua/~pavel/psi/psi1.jpg
or
http://www.nuos.edu.ua/~pavel/psi/psi-win2.PNG


the author of this screenshots sent a patch to trolltech so ....

vote!

--
 [ signature omitted ] 

Message 3 in thread

Stephen Collyer schrieb:
<snip>
> So:
> 
> 1) does anyone have any idea as to what I've screwed up ?
> (I'm currently leaning towards the subtle-bug-in-Qt/VSC++
> option, but I'm willing to be convinced otherwise)
> 
> 2) is there anything more I can do to track this problem down ?
> I'm currently stumped. I've found a single reference to
> QT_DEBUG_COMPONENTS in Qt Assistant but I'm not sure what that's
> for - should I be rebuilding everything with this defined, and
> trying again ?
> 
Maybe it's worth taking a look / deleting 
HKCU\Software\Trolltech\OrganizationDefaults


HTH
Christian

--
 [ signature omitted ] 

Message 4 in thread

Christian Ehrlicher wrote:
> Stephen Collyer schrieb:
> <snip>
>> So:
>>
>> 1) does anyone have any idea as to what I've screwed up ?
>> (I'm currently leaning towards the subtle-bug-in-Qt/VSC++
>> option, but I'm willing to be convinced otherwise)
>>
>> 2) is there anything more I can do to track this problem down ?
>> I'm currently stumped. I've found a single reference to
>> QT_DEBUG_COMPONENTS in Qt Assistant but I'm not sure what that's
>> for - should I be rebuilding everything with this defined, and
>> trying again ?
>>
> Maybe it's worth taking a look / deleting
> HKCU\Software\Trolltech\OrganizationDefaults

Toll, prima, ausgezeichnet !!!!!!

You are a star. That solved the problem. However, it raises
another question, since the value in the appropriate key
contained a date stamp identical to the time at which I built
the .dll so presumably, the library loader failed to load the
same .dll at least once, so why should deleting the plugin cache
fix it ?

-- 
 [ signature omitted ] 

Message 5 in thread

Stephen Collyer schrieb:
> Christian Ehrlicher wrote:
>> Stephen Collyer schrieb:
>> <snip>
>>> So:
>>>
>>> 1) does anyone have any idea as to what I've screwed up ?
>>> (I'm currently leaning towards the subtle-bug-in-Qt/VSC++
>>> option, but I'm willing to be convinced otherwise)
>>>
>>> 2) is there anything more I can do to track this problem down ?
>>> I'm currently stumped. I've found a single reference to
>>> QT_DEBUG_COMPONENTS in Qt Assistant but I'm not sure what that's
>>> for - should I be rebuilding everything with this defined, and
>>> trying again ?
>>>
>> Maybe it's worth taking a look / deleting
>> HKCU\Software\Trolltech\OrganizationDefaults
> 
> Toll, prima, ausgezeichnet !!!!!!
> 
> You are a star. That solved the problem. However, it raises
> another question, since the value in the appropriate key
> contained a date stamp identical to the time at which I built
> the .dll so presumably, the library loader failed to load the
> same .dll at least once, so why should deleting the plugin cache
> fix it ?
> 
Maybe the lib could not be loaded because of a missing dep whic became 
available later?
The cache is fine but imho failed plugins (which failed to load, not 
which have a to low version number or other things) should not go into 
the plugin cache / should be checked the next time (maybe with a counter 
to stop loading after x times or so)...


Christian

--
 [ signature omitted ] 

Message 6 in thread

Christian Ehrlicher wrote:
> Stephen Collyer schrieb:
>> Christian Ehrlicher wrote:
>>> Stephen Collyer schrieb:
>>> <snip>
>>>> So:
>>>>
>>>> 1) does anyone have any idea as to what I've screwed up ?
>>>> (I'm currently leaning towards the subtle-bug-in-Qt/VSC++
>>>> option, but I'm willing to be convinced otherwise)
>>>>
>>>> 2) is there anything more I can do to track this problem down ?
>>>> I'm currently stumped. I've found a single reference to
>>>> QT_DEBUG_COMPONENTS in Qt Assistant but I'm not sure what that's
>>>> for - should I be rebuilding everything with this defined, and
>>>> trying again ?
>>>>
>>> Maybe it's worth taking a look / deleting
>>> HKCU\Software\Trolltech\OrganizationDefaults
>>
>> Toll, prima, ausgezeichnet !!!!!!
>>
>> You are a star. That solved the problem. However, it raises
>> another question, since the value in the appropriate key
>> contained a date stamp identical to the time at which I built
>> the .dll so presumably, the library loader failed to load the
>> same .dll at least once, so why should deleting the plugin cache
>> fix it ?
>>
> Maybe the lib could not be loaded because of a missing dep whic became
> available later?
> The cache is fine but imho failed plugins (which failed to load, not
> which have a to low version number or other things) should not go into
> the plugin cache / should be checked the next time (maybe with a counter
> to stop loading after x times or so)...

OK, I now understand. I had to correct the path to the MySQL lib
after I first tried to load the plugin. At the time, I wasn't
aware of the plugin caching mechanism, so I expected it to work
immediately.

I agree that the plugin caching logic should be changed, or
at least there should be some more more info available on
failed load attempts.

-- 
 [ signature omitted ]