Results 1 to 3 of 3

Thread: Building QODBC and QMYSQL

  1. #1
    Join Date
    May 2007
    Location
    Warsaw, Poland
    Posts
    52
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Building QODBC and QMYSQL

    Hello everybody.
    I need some help. I have been trying to do two things connected to QtSQL module.
    I want to build QMYSQL and QODBC plugins to my open source 4.3.2 edition.
    My OS is UBUNTU.

    1) QMYSQL
    I have downloaded development packages.
    For mysql:
    /usr/lib/ contains libmysqlclient.so
    /usr/include/ contains mysql folder with:
    errmsg.h my_getopt.h mysqld_ername.h ndb
    keycache.h my_global.h mysqld_error.h raid.h
    m_ctype.h my_list.h mysql_embed.h sql_common.h
    m_string.h my_net.h mysql.h sql_state.h
    my_alloc.h my_no_pthread.h mysql_time.h sslopt-case.h
    my_config.h my_pthread.h mysql_version.h sslopt-longopts.h
    my_dbug.h my_semaphore.h my_sys.h sslopt-vars.h
    my_dir.h mysql_com.h my_xml.h typelib.h

    inside

    I strove to follow instructions below:
    http://doc.trolltech.com/4.3/sql-dri...x-and-mac-os-x
    Hence my input into bash was:
    mtr@mtr-laptop:/usr/local/Trolltech/Qt-4.3.2/plugins/sqldrivers/mysql$ sudo qmake -o Makefile "INCLUDEPATH+=/usr/include" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro
    Error processing project file: /usr/local/Trolltech/Qt-4.3.2/plugins/sqldrivers/mysql/mysql.pro
    mtr@mtr-laptop:/usr/local/Trolltech/Qt-4.3.2/plugins/sqldrivers/mysql$ sudo touch mysql.pro
    mtr@mtr-laptop:/usr/local/Trolltech/Qt-4.3.2/plugins/sqldrivers/mysql$ sudo qmake -o Makefile "INCLUDEPATH+=/usr/include" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro
    mtr@mtr-laptop:/usr/local/Trolltech/Qt-4.3.2/plugins/sqldrivers/mysql$ sudo make
    g++ -o mysql -L/usr/share/qt3/lib -L/usr/X11R6/lib -L/usr/lib -lmysqlclient_r -lqt-mt -lXext -lX11 -lm -lpthread
    /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function `_start':
    (.text+0x18): undefined reference to `main'
    collect2: ld returned 1 exit status
    make: *** [mysql] Błąd 1
    mtr@mtr-laptop:/usr/local/Trolltech/Qt-4.3.2/plugins/sqldrivers/mysql$
    What is wrong?

    2) ODBC
    I have downloaded a package from unixODBC project website.
    I have installed it in /usr/local/unixODBC-2.2.12 folder.
    Then I followed or rather I tried to follow the instructions below:
    http://doc.trolltech.com/4.3/sql-dri...x-and-mac-os-x
    The
    sudo qmake "INCLUDEPATH+=/usr/local/unixODBC-2.2.12/include" "LIBS+=L/usr/local/unixODBC-2.2.12/lib -lodbc"
    syntax of qmake is wrong as after typing it one receives manual for qmake.

    I do not want to grope for a solution.
    If anyone helps me with step-by-step instruction what to do I will be very grateful.

    Mike

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

    Default Re: Building QODBC and QMYSQL

    -L/usr/share/qt3/lib
    Seems you are mixing Qt3 into the issue here. Aren't you using qmake from Qt3 by any chance? What does qmake -v return?

    As for odbc, you seem to be in an incorrect directory.

  3. #3
    Join Date
    May 2007
    Location
    Warsaw, Poland
    Posts
    52
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Building QODBC and QMYSQL

    I've seen it.
    But look:
    mtr@mtr-laptop:~$ qmake -v
    QMake version 2.01a
    Using Qt version 4.3.2 in /usr/local/Trolltech/Qt-4.3.2/lib
    There is one oddity more:
    I ran ./configure -qt-sql-mysql. Then I made it and installed qt once again.
    As an effect there emerged libqsqlodbc.so in plugins/sqldrivers/ folder.
    I understand that it is because during installation qt found new repositories of odbc downloaded by me apart from unixODBC.

    Still I do not have QMYSQL...
    EDIT
    Look:
    QSqlDatabase: available drivers: QMYSQL3 QMYSQL QSQLITE QODBC3 QODBC
    I have tested QMYSQL and it works.
    Thus I understand that everything is fine...
    The funny thing is that although there is libqsqlodbc.so library in sqldrivers folder there is absolutely no trace of mysql library for qt.
    Last edited by mtrpoland; 25th November 2007 at 16:34.

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
  •  
Qt is a trademark of The Qt Company.