Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [SOLVED] Why no libqsqlodbc.so?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Why no libqsqlodbc.so?

Scheduled Pinned Locked Moved Installation and Deployment
8 Posts 3 Posters 4.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hskoglund
    wrote on 25 Mar 2014, 03:23 last edited by
    #1

    Hi, I'm writing a Qt app that connects to an MS SQLServer 2005.

    Currently I only really need the app to work in Windows (which works fine) but because I have this fancy blog where I document how to do Qt stuff for both Windows, Mac and Linux, I decided to try having a chat with the SQLServer from OSX or from Linux. I mean, how hard could it be?

    Well two (2) nights and many cups of coffee later I got it working for OSX. Instead of that oneliner in Windows (.setDatabaseName(...) you have to build a libtdsodbc.0.so and write two files, odbc.ini and .freetds.conf. But now I can talk to the SQLServer from my Mac, yippee :-)

    Then I tried Linux (Ubuntu 13.10) (it couldn't be worse than OSX I thought) when I discovered a showstopper: there's no DLL included for ODBC in Qt 5.2.1 for Linux :-( I.e. I can't find the file libqsqlodbc.so in plugins/sqldrivers.

    Anyone knows why? Is it because SQLServer is not so popular in Linux or?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 25 Mar 2014, 08:13 last edited by
      #2

      Hi,

      AFAIK, PostgreSQL and MySQL (mariaDB) are the most used servers on linux and until now I must say most of the user of ODBC I saw where on windows (not that it means they are the only one).

      You could open a discussion about it on the interest mailing list

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hskoglund
        wrote on 25 Mar 2014, 16:14 last edited by
        #3

        Well, agreed PostgreSQL and MyMaria are much more popular on Linux, but since Microsoft is using Qt (for example, Microsoft Remote Desktop for Mac is written in Qt) I think Qt should be nice to Microsoft and support SQL Server on Linux as well (just joking :-).

        Anyway, I found Qt's interest mailing list, thanks for the pointer!

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 25 Mar 2014, 22:18 last edited by
          #4

          A bit more documentation about it would probably be welcome :-)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andreyc
            wrote on 25 Mar 2014, 22:38 last edited by
            #5

            From my observation of the Qt configuration script:
            It has an option "plugin-sql-<driver>".
            If odbc or iodbc is specified then the script will run the checks on unix/odbc and unix/iodbc libraries.

            So, in a theory it is possible to have odbc sql plugin on linux if you have "odbc":http://www.unixodbc.org/ or "iodbc":http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/ libraries installed.

            1 Reply Last reply
            0
            • H Offline
              H Offline
              hskoglund
              wrote on 25 Mar 2014, 22:52 last edited by
              #6

              Hmmm, thanks I might give it a try, I learned on the Mac about unixodbc and iodbc (OSX comes with an old iodbc preinstalled, that's what I used).

              On Debian/Ubuntu it's pretty easy, just apt-get iodbc and/or unixodbc.

              Then on both Mac and Linux you have to get freetds running, on the Mac I had to build it myself, but on Debian/Ubuntu it's just another apt-get.

              But I'm a complete noob when building Qt from the command line and all the options, it seems in this case it is not sufficient just to open the qt.pro file from QtCreator :-)

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andreyc
                wrote on 26 Mar 2014, 03:51 last edited by
                #7

                I have built qtbase from the sources but without odbc.
                It went smooth. I was using ubuntu 12.04, 14.04, fedora 20
                My steps after applying all changes described in "this article":http://qt-project.org/wiki/Building_Qt_5_from_Git
                @
                tar xJf qtbase-opensource-src-5.2.1.tar.xz
                cd qtbase-opensource-src-5.2.1
                ./configure -prefix $prefix -nomake examples -no-rpath -opensource -confirm-license -qt-sql-sqlite -plugin-sql-sqlite -qt-libpng -qt-xcb
                make
                make install
                @

                After that I build and installed qtdeclarative-opensource-src-5.2.1.tar.xz
                But I do not use qtdeclarative in my project, so I deleted it later from my installation.
                @
                tar xJf qtdeclarative-opensource-src-5.2.1.tar.xz
                mkdir build-qtdeclarative
                cd build-qtdeclarative
                /path/where/qtbase/installed/bin/qmake ../qtdeclarative-opensource-src-5.2.1
                make
                make install
                @

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  hskoglund
                  wrote on 26 Mar 2014, 06:37 last edited by
                  #8

                  Thanks for the command line stuff, if I get this work I promise I at least write about in my blog (as SGaist says above, a bit more documentation..)

                  BTW: totally off-topic, but I saw that option in ./configure: -no-rpath
                  Another hidden gem in Qt (!) very useful for an idea I have:

                  QtCreator should have a Build For Distribution menu command, where it creates a directory prefixed "distribution-.." instead of "build-". For Windows, it copies msvcr110.dll etc. to it, for Linux it does that -no-rpath trick and for the Mac it runs macdeployqt for you, and of course copy the needed plugin DLLs to the proper subdirectory in the distribution folder. If we had this, some of the often repeating questions on this forum would not appear so much.
                  (This is something I probably should post on the Qt interest mailing list.)

                  1 Reply Last reply
                  0

                  1/8

                  25 Mar 2014, 03:23

                  • Login

                  • Login or register to search.
                  1 out of 8
                  • First post
                    1/8
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved