Results 1 to 4 of 4

Thread: undefined references to mysql

  1. #1
    Join Date
    Feb 2009
    Posts
    7

    Default undefined references to mysql

    Hi,
    When compiling Qt static on windows 7 with mysql I get undefined refrences errors like:

    Qt Code:
    1. c:\Qt\4.7.3-static\lib/libQtSql.a(qsql_mysql.o):qsql_mysql.cpp:(.text+0x47ae): undefined reference to `mysql_stmt_attr_set@12'
    To copy to clipboard, switch view to plain text mode 

    I found out that "mysql_stmt_attr_set" is a function of mysql.

    So in the file qsql_mysql.cpp there are a lot of mysql-functions used that all give an undefined reference error.

    I configured Qt like this:

    Qt Code:
    1. configure -release -opensource -static -L C:\mysql\lib\opt -L C:\mysql\lib -I C:\mysql\include -nomake examples -nomake demos -no-exceptions -no-stl -no-rtti -no-qt3support -no-scripttools -no-openssl -no-opengl -webkit -qt-sql-mysql -platform win32-g++ -qt-zlib -qt-gif -qt-libpng -qt-libtiff -qt-libjpeg
    To copy to clipboard, switch view to plain text mode 

    C:\mysql\lib\opt, C:\mysql\lib and C:\mysql\include is where all the mysql libs and includes are.

    Is there something wrong with the configure statement? Does it not find all the neccessary mysql includes or libs?

    Can somebody please help, or point me in the right direction?
    Thanks.

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: undefined references to mysql

    it may help if you show the output from the build process and the contents of your .pro file.

    I have never tried to build static apps (licensing implications). Try googling "mysql static compile Qt".

  3. #3
    Join Date
    Feb 2009
    Posts
    7

    Default Re: undefined references to mysql

    I'm not compiling a program, I'm trying to compile/install Qt.

    I get the undefined reference errors after mingw32-make.

    I searched all the guides to install Qt with mysql static and followed all instruction I could find. I keep getting the undefined reference errors.

    The errors are all with respect to mysql. So I think while compiling Qt it doesn't use the libs and includes from mysql, it can't find them or the necessary ones aren't there. But I did instaal mysql with libs and includes.

    I have no idea what can be wrong here.

    Please help if you have an idea of what might be going wrong.
    Thanks

  4. #4
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: undefined references to mysql

    did you build the static mysql driver plugin?

    perhaps this will be useful:
    http://www.qtcentre.org/threads/1815...c-mysql-plugin

Similar Threads

  1. Question about references in C++
    By jano_alex_es in forum General Programming
    Replies: 10
    Last Post: 18th January 2011, 12:19
  2. Replies: 3
    Last Post: 27th October 2010, 10:09
  3. Replies: 0
    Last Post: 19th November 2009, 19:02
  4. Pointers and references
    By PaceyIV in forum Newbie
    Replies: 10
    Last Post: 27th July 2009, 10:53
  5. QWebView undefined references
    By xtreme in forum Qt Programming
    Replies: 2
    Last Post: 28th July 2008, 08:08

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.