Results 1 to 2 of 2

Thread: Statically compiled Qt 4.1.4 and mySql

  1. #1
    Join Date
    Nov 2006
    Posts
    72
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Statically compiled Qt 4.1.4 and mySql

    Hi! I ve searched all forum, and tried a lot of things, but didn't solve my problem. I have no hope but to post here. I have statically compiled Qt 4.1.4. which I use with Mingw. I need to build application which previosly worked fine with SQLITE database to work with MYSQL database. This is what I've tried so far.
    I've found mysql-noinstall-5.0.27-win32
    went to it's lib/opt directory and did:
    reimp -d libmysql.lib
    dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a

    cd c:\Qt\4.1.4 //obviously, i am using qt 4.1.4
    configure -plugin-sql-mysql -I C:\mysql\INCLUDE //C:\mysql is where I put my mysql directory
    then went to

    cd c:\qt\4.1.4\src\plugins\sqldrivers\mysql
    qmake -o Makefile "INCLUDEPATH+=C:\mysql\INCLUDE " "LIBS+=-LC:\mysql\LIB\OPT -lmysql" mysql.pro
    But I still get "mysql driver not loaded" or something like that.
    Now, qoogling all over the internet I have found that i need to put some more options to my .pro file because I have statically compiled Qt. But, because my application is consisted of two projects (one, "dbm" library and "importer" application) i've puted in both pro files QTPLUGIN += qsqlmysql option. Each project has one class. Above constructors of those classes, I've put: Q_IMPORT_PLUGIN(qsqlmysql)
    (Btw, for all those options read here: http://doc.trolltech.com/4.2/plugins...tatic-plugins). Maybe I did something wrong here, don't really know, these are all shots from the hip. When I compile my "dbm" library it all goes fine. But when I compile my application I get this error:
    L"c:\Qt\4.1.4\lib" -lmingw32 -lqtmaind -lQtSqld4 -lQtXmld4 -lQtGuid4 -lQtCored4 -LC:\Qt\4.1.4\plugins/sqldrivers/ -lqsqlmysqld
    ./debug\Importer.o(.text$_ZN29StaticqsqlmysqlPluginI nstanceC1Ev[StaticqsqlmysqlPluginInstance::StaticqsqlmysqlPlug inInstance()]+0x9): In function `ZSt14__copy_trivialIP19TestProgramLocationEPT_PKS 2_S5_S3_':
    C:/MinGW1/bin/../lib/gcc/i686-pc-mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_algobase.h: undefined reference to `qt_plugin_instance_qsqlmysql()'
    collect2: ld returned 1 exit status
    And I don't have a clue what that really means
    So, can anybody help me? Can anybody say to me what have I done wrong? What I need to do, to have my mysgl driver built and included so I can use it?
    If my post looks confusing to you, ask me what you want me to clarify, because I am clueless. I would be very grateful for any idea. Thank you in advance.
    Last edited by jacek; 25th January 2007 at 19:26. Reason: changed [html] to [quote]

  2. #2
    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: Statically compiled Qt 4.1.4 and mySql

    Have you looked at this wiki page? http://wiki.qtcentre.org/index.php?t...ws_using_MinGW

    Also, it is likely to be a problem with the plug-in cache - you can find a link to info about that at the bottom of the wiki page referred to above.

Similar Threads

  1. MySql plugin driver issues
    By stevey in forum Installation and Deployment
    Replies: 11
    Last Post: 20th September 2006, 13:45
  2. 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
  3. 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.