Results 1 to 4 of 4

Thread: question about sqldrivers

  1. #1
    Join Date
    Apr 2012
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile question about sqldrivers

    hi,

    I have a program with mysql in linux. So i need the qsqlmysql.so . I put the qsqlmysql.so to the directory /usr/local/Trolltech/qt4.4.3/plugins/sqldrivers/, my program worked ok. But when I put the qsqlmysql.so to the directory /usr/local/Trolltech/qt4.4.3/lib/ ,it tell me driver not loaded, that the program cannot find the lib.
    the LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Trolltech/qt4.4.3/lib/

    so I think it will be worked ok, But it is not when I put the qsqlmysql.so to the directory /usr/local/Trolltech/qt4.4.3/lib/ . It seems that I must put the qsqlmysql.so to the directory /usr/local/Trolltech/qt4.4.3/plugins/sqldrivers/。

    Is that really?
    I am confused, and I don't know the reason.

    thankyou for your help

    thankyou

  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: question about sqldrivers

    As the docs say the driver should be in a subdirectory "sqldrivers" of a directory where the application searches for plugins (e.g. the directory where the application binary is located).
    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. #3
    Join Date
    Apr 2012
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: question about sqldrivers

    thanks for your answer.
    I know what the docs say. But I want to know why the driver should be a subdirectory "sqldrivers" of a directory.
    whether can I control the application ,and tell it where to search plugins?

  4. #4
    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: question about sqldrivers

    Quote Originally Posted by yuzhouzhiwai View Post
    But I want to know why the driver should be a subdirectory "sqldrivers" of a directory.
    Because that's where the code that loads sql drivers looks for them.

    whether can I control the application ,and tell it where to search plugins?
    You can control where the application looks for plugins but it will still look into specific subdirectories of the path you provide. If you don't want that, you can embed plugin code directly in your application (however of course it won't be a plugin anymore and will be part of your app regardless if the app needs it or not).
    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.


Similar Threads

  1. How to use sqldrivers with iOS?
    By Clever&Smart in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 8th July 2013, 09:13
  2. Qt 4.8, mac and sqldrivers...
    By jyavenard in forum Installation and Deployment
    Replies: 1
    Last Post: 28th February 2012, 08:52
  3. XML question(s)
    By Zzoni in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2009, 22:39
  4. few question about skd 3rd v1.1
    By estel in forum Newbie
    Replies: 3
    Last Post: 2nd July 2009, 07:08
  5. Wierd behavior when loading sqldrivers
    By BadKnees in forum Qt Programming
    Replies: 0
    Last Post: 19th March 2009, 10:32

Tags for this Thread

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.