Results 1 to 4 of 4

Thread: Loading QSQLite plugin under Windows: works, but... [SOLVED]

  1. #1
    Join Date
    Jul 2009
    Location
    Italy, Pieve Ligure (GE)
    Posts
    55
    Thanks
    7
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Loading QSQLite plugin under Windows: works, but... [SOLVED]

    Hello,

    * Windows XP SP3;
    * "Full" SDK 2009.04 installed (in D:\Dev\Qt\);
    * developing a Qt application which uses the SQLite plugin.

    So I added to the .pro:
    Qt Code:
    1. QT += sql
    2. QTPLUGIN += qslqlite
    To copy to clipboard, switch view to plain text mode 
    At compile, I got the error:

    D:\Dev\Qt\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\.. \..\..\mingw32\bin\ld.exe: cannot find -lqsqlited

    Looking at the last compiler command, I noticed:

    g++ [...many options removed...],-subsystem,windows [...many object files removed...] -L"d:\Dev\Qt\qt\lib" -lmingw32 -lqtmaind -LD:/Dev/Qt/qt/plugins/sqldrivers -lqsqlited -lQtWebKitd4 -lQtSqld4 -lQtXmld4 -lQtGuid4 -lQtCored4


    Now, the D:/Dev/Qt/qt/plugins/sqldrivers directory does NOT contain any qsqlited.dll file, but it DOES contain a qsqlited4.dll file!

    So, I copied qsqlited4.dll to qsqlited.dll, recompiled and, lo! everything works.

    Now, the question:

    Is this supposed to work this way, by renaming a distribution file? May this trick have side effects? None surfaced so far, but I cannot be sure. Has anybody had similar experiences?

    Thanks,
    M.
    Last edited by miwarre; 11th November 2009 at 14:44.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Loading QSQLite plugin under Windows: works, but...

    You are trying to compile your application in debug mode while you only have the plugin in release mode. Apart from that you are linking with the plugin which doesn't make much sense. You needn't do that. Just build your app in release mode after you remove the QTPLUGIN+=sqlite line and your app should work just fine and load the plugin when you initialize the application object.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following 3 users say thank you to wysota for this useful post:

    AD (11th November 2009), ajo (10th June 2013), miwarre (11th November 2009)

  4. #3
    Join Date
    Jun 2008
    Location
    Saint-Petersburg
    Posts
    50
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Loading QSQLite plugin under Windows: works, but...

    Thanks for this answer! )))

  5. #4
    Join Date
    Jul 2009
    Location
    Italy, Pieve Ligure (GE)
    Posts
    55
    Thanks
    7
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Loading QSQLite plugin under Windows: works, but...

    Quote Originally Posted by wysota View Post
    You are trying to compile your application in debug mode while you only have the plugin in release mode.
    Not really: qsqlited4.dll is debug.
    Apart from that you are linking with the plugin which doesn't make much sense. You needn't do that. Just build your app in release mode after you remove the QTPLUGIN+=sqlite line and your app should work just fine and load the plugin when you initialize the application object.
    YES!!

    I thought the QTPLUGIN+=... .pro line was required to dynamically load the plugin, while the Q_IMPORT_PLUGIN(...) macro in the code triggered the (static) linking. At least, this is what I grasped from the docu...

    Anyway, it works without messing with file names. Thanks!

    M.

Similar Threads

  1. Qt 4.3.1 Windows Svg plugin problem
    By tzioboro in forum Installation and Deployment
    Replies: 7
    Last Post: 14th September 2007, 10:37
  2. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 14:13
  3. plugin loading problem
    By naresh in forum Qt Programming
    Replies: 6
    Last Post: 9th June 2007, 19:05
  4. Qt Designer plugin on windows
    By big4mil in forum Newbie
    Replies: 4
    Last Post: 30th May 2007, 17:33
  5. Application plugin on windows
    By Eyee in forum Qt Programming
    Replies: 2
    Last Post: 22nd March 2006, 17:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.