Results 1 to 4 of 4

Thread: Building a static mysql driver

  1. #1
    Join Date
    Oct 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Building a static mysql driver

    Hello everybody,

    I am trying to do a static build of QT 4.7.0, but even after more than 2 weeks it still isnt done


    My Environment:
    QT 4.7.0 commercial
    Visual Studio 2008
    NASM 2.10
    ActivePerl 5.12.2
    MySQL 5.5.6
    OpenSSL 0.9.8o
    SQlite 3.7.3

    Configure: configure.exe -debug-and-release -commercial -static -ltcg -no-fast -exceptions -stl -qt-sql-mysql -qt-sql-sqlite -platform win32-msvc2008 -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg -dsp -vcproj -incredibuild-xge -plugin-manifests -qmake -process -rtti -mmx -3dnow -sse -sse2 -openssl-linked -script -scripttools -qt-style-windows -qt-style-windowsxp -qt-style-windowsvista -qt-style-plastique -qt-style-cleanlooks -qt-style-motif -qt-style-cde -I "C:\mysql5\include" -L "C:\mysql5\lib" -I "C:\openssl\include" -L "C:\openssl\lib" -I "C:\Qt\sqlite-amalgamation-3_7_3"

    My current problem is the mysql driver, as you can see from my configure I have added the include and lib files for mysql, the libmysql.lib file exists. I get 50 unresolved externals, similar to the errors postet here. But as I am using VS2008 and not MinGW, dll format shouldnt be the problem.

    The full error log is in the attachted file (too big to post here), but a short version follows:
    Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
    Copyright (C) Microsoft Corporation. All rights reserved.

    "C:\Programme\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" -f Makefile.
    Debug all

    Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
    Copyright (C) Microsoft Corporation. All rights reserved.

    link /LIBPATH:"c:\Qt\4.7.0\lib" /LIBPATH:"c:\Qt\4.7.0\plugins\sqldrivers
    " /LIBPATH:"c:\Qt\4.7.0\lib" /NOLOGO /DEBUG /MANIFEST /MANIFESTFILE:"tmp\obj\deb
    ug_static\assistant.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDEN
    CY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publi
    cKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:..\..\
    ..\..\bin\assistant.exe @C:\DOKUME~1\BliZZarD\LOKALE~1\Temp\nm54F.tmp
    QtSqld.lib(qsql_mysql.obj) : error LNK2019: unresolved external symbol _mysql_fe
    tch_field@4 referenced in function "public: bool __thiscall QMYSQLResultPrivate:
    :bindInValues(void)" (?bindInValues@QMYSQLResultPrivate@@QAE_NXZ)
    QtSqld.lib(qsql_mysql.obj) : error LNK2019: unresolved external symbol _mysql_nu
    m_fields@4 referenced in function "public: bool __thiscall QMYSQLResultPrivate::
    bindInValues(void)" (?bindInValues@QMYSQLResultPrivate@@QAE_NXZ)
    QtSqld.lib(qsql_mysql.obj) : error LNK2019: unresolved external symbol _mysql_st
    mt_result_metadata@4 referenced in function "public: bool __thiscall QMYSQLResul
    tPrivate::bindInValues(void)" (?bindInValues@QMYSQLResultPrivate@@QAE_NXZ)


    [... ...]

    ..\..\..\..\bin\assistant.exe : fatal error LNK1120: 50 unresolved externals
    NMAKE : fatal error U1077: '"C:\Programme\Microsoft Visual Studio 9.0\VC\BIN\lin
    k.EXE"' : return code '0x460'
    Stop.
    NMAKE : fatal error U1077: '"C:\Programme\Microsoft Visual Studio 9.0\VC\BIN\nma
    ke.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    Please, can anybody tell me what I am doing wrong? This makes me go crazy :/

    Many thanks in advance,

    BliZZarD
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Building a static mysql driver

    Is the mysql library compiled with the same compiler as you're using to build the static Qt library? If not, no luck as the symbols of the mysql library can't be found.

    Why do you want to build Qt static?

  3. #3
    Join Date
    Oct 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Building a static mysql driver

    At first, I tried it using the include and lib files from the official mysql installer (Installer -> Development files). Because I thought of the common problem (porting libs between MinGW and VS calling conventions), too I tried it again and compiled MySQL using VS2008 on the same machine, same config. Output was: exactly the same. I tried moving the *.lib/*.dll files into the QT folders (in src/sqldrivers etc), no change.

    And I also tried the same setup using Visual Studio 2010 - exact same problems.


    I am programming a small command line application for a company, they require a single *.exe file (size does not matter ) and do not want any required runtime libs. This means WAR.. ehh.. a static build of QT (magical pun provided free of charge).
    Or does it? If there is any other way to provide the appliaction and QT in a single file I'd love to hear it - but AFAIK there is none

  4. #4
    Join Date
    May 2009
    Location
    Vienna
    Posts
    91
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Building a static mysql driver

    Hi,
    you already have seen this?
    http://www.qtcentre.org/wiki/index.p...c_applications


    I tried with my projectfile the adds below, but on some test- machines, there are still some problems:
    So i don't know if this is all one needs..

    greetz Astronomy

    # -------------------------------------------------
    # Project created by QtCreator 2010-08-06T17:09:30
    # -------------------------------------------------
    TARGET = ComaGui
    CONFIG += static
    CONFIG += staticlib
    TEMPLATE = app
    SOURCES += main.cpp \
    mainwindow.cpp \

Similar Threads

  1. I need MySQL driver for Qt 4.6, WindowsXP(32), MySQL 5.1
    By User_3 in forum Installation and Deployment
    Replies: 7
    Last Post: 15th October 2010, 15:19
  2. Driver MySQL Built, but...
    By vinny gracindo in forum Newbie
    Replies: 1
    Last Post: 28th March 2010, 16:06
  3. [qt 4.6] mysql driver
    By vinny gracindo in forum Newbie
    Replies: 0
    Last Post: 25th February 2010, 22:28
  4. Building new SQL driver
    By Pragya in forum Installation and Deployment
    Replies: 1
    Last Post: 27th June 2007, 08:46
  5. nmake problems while building mysql driver
    By MarkoSan in forum Installation and Deployment
    Replies: 27
    Last Post: 25th May 2007, 12:57

Tags for this Thread

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.