Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. can not load libqsqlodbc.so build with unixODBC
Qt 6.11 is out! See what's new in the release blog

can not load libqsqlodbc.so build with unixODBC

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.2k 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.
  • B Offline
    B Offline
    BobZ
    wrote on last edited by
    #1

    hi
    every one,
    I need to connect mssqlserver,then I find a way by using unixODBC and freetds.
    I installed qt4.8.7 on my ubuntu.
    frist I dowload qt-ererywhere-opensource-src-4.7.8 and unixODBC-2.3.2. then I enter unixODBC directory,execute

    "./configure --prefix=/usr/local/unixODBC",
    "make",
    "makeinstall",

    no error found .
    Next I enter "~/qt-everywhere-opensource-src-4.7.8/src/plugins/sqldrivers/odbc",execute

    qmake "INCLUDEPATH+=/usr/local/unixODBC/include" "LIBS+=-L/usr/local/unixODBC/lib -lodbc" odbc.pro
    make ,
    make install,

    no error found the same, and /usr/lib/i386-linux-gnu/qt4/plugins/sqldrivers/libqsqlodbc.so generated. but when I try to load load the odbc in my library with code below:
    QStringList strList = QSqlDatabase::drivers();
    qDebug()<<strList;

    only ("QSQLITE") was printed.
    and if I build the odbc without lodbc,just

    qmake "INCLUDEPATH+=/usr/local/unixODBC/include"odbc.pro

    ("QSQLITE","QOBDC3","QODBC") was print,
    when I try to open the QSqlDatabase,error print below

    symbol lookup error: /usr/lib/i386-linux-gnu/qt4/plugins/sqldrivers/libqsqlodbc.so: undefined symbol: SQLAllocHandle

    I am stuck here for two days ,Is any body can help me ,thanks.

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Hi, I think you need to rebuild libqsqlodbc.so with that -lodbc switch, for example see here

      B 1 Reply Last reply
      1
      • hskoglundH hskoglund

        Hi, I think you need to rebuild libqsqlodbc.so with that -lodbc switch, for example see here

        B Offline
        B Offline
        BobZ
        wrote on last edited by
        #3

        @hskoglund
        I had try this by add option to qmake
        qmake "INCLUDEPATH+=/usr/local/unixODBC/include" "LIBS+=-L/usr/local/unixODBC/lib -lodbc" odbc.pro
        by this way , QSqlDatabase::drivers() can not find "QODBC",only "QSQLITE" is Found.

        1 Reply Last reply
        0

        • Login

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