Results 1 to 6 of 6

Thread: Need to compile with MySQL drivers/plugins

  1. #1
    Join Date
    Jan 2007
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Need to compile with MySQL drivers/plugins

    I need to use Qt to develop applications to access MySQL on linux systems but I want to setup Qt on windows for now due laptop portability. I will purchase the commercial version of Qt if it works out but I can not get the MySql driver to compile.
    I have tried for months (following every tutorial/instructions I could find) to compile Qt with -qt-sql-mysql but no success. Here is the last thing I tried.
    I extracted the mingw-utils
    I copied the reimp.exe to my MinGW\bin directory
    I ran: reimp -d libmysql.lib <all ok>
    I ran: dlltool -k -d libmysql.def -l libmysql.a <all ok>
    I ran: configure.exe -I C:\mysql\include -L C:\mysql\lib\opt -qt-sql-mysql <all ok>
    I get the message: Just run mingw32-make
    I ran: mingw32-make <not ok>
    It runs for quite a while and throws errors.
    Here are the last several lines.
    C:/Qt/4.1.1/src/sql/drivers/mysql/qsql_mysql.cpp:1113: undefined reference to `m
    ysql_query@8'
    ./tmp\obj\debug_shared\qsql_mysql.o(.text+0x721e): In function `ZN12QMYSQLDriver
    17commitTransactionEv':
    C:/Qt/4.1.1/src/sql/drivers/mysql/qsql_mysql.cpp:1130: undefined reference to `m
    ysql_query@8'
    ./tmp\obj\debug_shared\qsql_mysql.o(.text+0x73d8): In function `ZN12QMYSQLDriver
    19rollbackTransactionEv':
    C:/Qt/4.1.1/src/sql/drivers/mysql/qsql_mysql.cpp:1147: undefined reference to `m
    ysql_query@8'
    ./tmp\obj\debug_shared\qsql_mysql.o(.text+0x78b2): In function `ZNK12QMYSQLDrive
    r11formatValueERK9QSqlFieldb':
    C:/Qt/4.1.1/src/sql/drivers/mysql/qsql_mysql.cpp:1172: undefined reference to `m
    ysql_escape_string@12'
    collect2: ld returned 1 exit status
    mingw32-make[3]: *** [..\..\lib\QtSqld4.dll] Error 1
    mingw32-make[3]: Leaving directory `C:/Qt/4.1.1/src/sql'
    mingw32-make[2]: *** [debug-all] Error 2
    mingw32-make[2]: Leaving directory `C:/Qt/4.1.1/src/sql'
    mingw32-make[1]: *** [sub-sql-make_default-ordered] Error 2
    mingw32-make[1]: Leaving directory `C:/Qt/4.1.1/src'
    mingw32-make: *** [sub-src-make_default-ordered] Error 2

    Suggestions?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need to compile with MySQL drivers/plugins

    In what directory did you place libmysql.a?

  3. #3
    Join Date
    Jan 2007
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need to compile with MySQL drivers/plugins

    I placed libmysql.a in C:\mysql\lib\opt

  4. #4
    Join Date
    Jan 2007
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need to compile with MySQL drivers/plugins

    Searching this forum, I tried following direction on a thread that were slightly different that what I originaly posted and this is the output when it errored during make.
    QtSql" -I"C:/Qt/4.1.1/include" -I"C:/Mysql/include" -I"C:/mysql/include" -I"C:/Q
    t/4.1.1/include/ActiveQt" -I"tmp\moc\debug_shared" -I"." -I"C:/Qt/4.1.1/mkspecs/
    win32-g++" -o tmp\obj\debug_shared\qsql_mysql.o ..\..\..\sql\drivers\mysql\qsql_
    mysql.cpp
    g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runt
    ime-pseudo-reloc -shared -Wl,--out-implib,C:\Qt\4.1.1\plugins\sqldrivers\libqsql
    mysqld.a -o "..\..\..\..\plugins\sqldrivers\qsqlmysqld.dll " tmp\obj\debug_shared
    \main.o tmp\obj\debug_shared\qsql_mysql.o -L"C:\Qt\4.1.1\lib" -L"C:\Qt\4.1.1\li
    b" C:\mysql\lib\opt -lmysql -lQtSqld4 -lQtCored4
    C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\ mingw32\bin\ld.exe: C:\mysql\l
    ib\opt: No such file: Permission denied
    collect2: ld returned 1 exit status
    mingw32-make[5]: *** [..\..\..\..\plugins\sqldrivers\qsqlmysqld.dll] Error 1
    mingw32-make[5]: Leaving directory `C:/Qt/4.1.1/src/plugins/sqldrivers/mysql'
    mingw32-make[4]: *** [debug-all] Error 2
    mingw32-make[4]: Leaving directory `C:/Qt/4.1.1/src/plugins/sqldrivers/mysql'
    mingw32-make[3]: *** [sub-mysql-make_default] Error 2
    mingw32-make[3]: Leaving directory `C:/Qt/4.1.1/src/plugins/sqldrivers'
    mingw32-make[2]: *** [sub-sqldrivers-make_default] Error 2
    mingw32-make[2]: Leaving directory `C:/Qt/4.1.1/src/plugins'
    mingw32-make[1]: *** [sub-plugins-make_default-ordered] Error 2
    mingw32-make[1]: Leaving directory `C:/Qt/4.1.1/src'
    mingw32-make: *** [sub-src-make_default-ordered] Error 2

  5. #5
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need to compile with MySQL drivers/plugins

    I just needed the QMYSQL module built for Open Source Qt + mingw. This wiki post summarizes my experiences: http://wiki.qtcentre.org/index.php?t...ws_using_mingw .

  6. #6
    Join Date
    Jan 2007
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: Need to compile with MySQL drivers/plugins

    Thank you, That seemed to have worked.
    I have not created a program to access mysql but using the Qt SQL Browser that came in the demos directory, it does query the mysql database and shows the table contents.
    Now I can get started learning.

    Being new, I still am not sure what all of the directions did but I guess this will come in time.

Similar Threads

  1. Deploying with MySQL support under Windows
    By KShots in forum Installation and Deployment
    Replies: 1
    Last Post: 12th October 2006, 09:19
  2. Qt and MySQL Database Connection
    By shamik in forum Qt Programming
    Replies: 41
    Last Post: 6th October 2006, 12:48
  3. Qt 4.1.4 & Mysql 5 on Linux x64
    By bothapn in forum Installation and Deployment
    Replies: 7
    Last Post: 4th August 2006, 13:23
  4. Qt 4.1 OS on Windows & mysql
    By neeko in forum Installation and Deployment
    Replies: 10
    Last Post: 31st January 2006, 20:22

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.