1 Attachment(s)
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:
Quote:
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
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?
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 :D) 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 :(
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 \