PDA

View Full Version : Can't build Qt with MySQL



Tottish
25th September 2010, 10:40
Hi!
I'm new on building in general and especially in Win. So I'm on Win7 and I am trying to follow this guide since I'm trying MySQL with Qt for the first time:
Build Qt with MySQL (http://christopher.rasch-olsen.no/2009/04/14/qt-45-and-mysql-plugin-with-mingw-on-windows-xp/)

Everything go as planned (seems I don't have to do the Qmake fix section) until actually building Qt.
I'm executing the last command in the guide and it starts the process and outputs a butload of text in the commandprompt for an hour or so but after that I just get this:



g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\2010.02.1\qt\lib\libQtWebKitd4.a
-o ..\..\..\..\lib\QtWebKitd4.dll object_script.QtWebKitd.Debug -L"c:\Qt\2010.
02.1\qt\lib" -L"c:\Qt\2010.02.1\qt\lib" obj\debug\QtWebKitd_resource_res.o -lwin
mm -lgdi32 -luser32 -lwinmm -ladvapi32 -lgdi32 -lshell32 -lshlwapi -luser32 -lve
rsion -lphonond4 -lQtXmlPatternsd4 -lQtGuid4 -lQtNetworkd4 -lQtCored4
Creating library file: c:\Qt\2010.02.1\qt\lib\libQtWebKitd4.a
./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHand ler.cpp:(.text+0x5a): undefi
ned reference to `vtable for WebCore::FormDataIODevice'
./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHand ler.cpp:(.text+0x12c): undef
ined reference to `vtable for WebCore::FormDataIODevice'
./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHand ler.cpp:(.text+0x1f1): undef
ined reference to `vtable for WebCore::FormDataIODevice'
./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHand ler.cpp:(.text+0x293): undef
ined reference to `vtable for WebCore::FormDataIODevice'
./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHand ler.cpp:(.text+0x335): undef
ined reference to `vtable for WebCore::FormDataIODevice'
./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHand ler.cpp:(.text+0x820): undef
ined reference to `vtable for WebCore::QNetworkReplyHandler'
./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHand ler.cpp:(.text+0xa9e): undef
ined reference to `vtable for WebCore::QNetworkReplyHandler'
./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHand ler.cpp:(.text+0xd22): undef
ined reference to `WebCore::QNetworkReplyHandler::processQueuedItems ()'
./obj\debug\FrameLoaderClientQt.o:FrameLoaderClientQ t.cpp:(.text+0x314b): undefi
ned reference to `QWebPage::unsupportedContent(QNetworkReply*)'
./obj\debug\FrameLoaderClientQt.o:FrameLoaderClientQ t.cpp:(.text+0x425e): undefi
ned reference to `QWebPage::downloadRequested(QNetworkRequest const&)'
collect2: ld returned 1 exit status
mingw32-make[2]: *** [..\..\..\..\lib\QtWebKitd4.dll] Error 1
mingw32-make[2]: Leaving directory `C:/Qt/2010.02.1/qt/src/3rdparty/webkit/WebCo
re'
mingw32-make[1]: *** [debug-all] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/2010.02.1/qt/src/3rdparty/webkit/WebCo
re'
mingw32-make: *** [sub-webkit-sub_src_target_ordered] Error 2

C:\Qt\2010.02.1\qt>cd src\plugins\sqldrivers\mysql


Any Idea on what might cause this? Seems to be some problem with the QNetworkReplyHandler...

If anyone have another easier guide on how to build MySQL plugin without using nmake or have an easy way to install and use nmake on Win7 so that I may follow the manual proceedings, please speak up, I don't necessarily need to use the mingw.


Cheers!
/Tottish

tbscope
25th September 2010, 18:55
One question: What do QNetworkReply and Qt Webkit have to do with the MySql plugin?

You might want to follow this guide:
http://doc.qt.nokia.com/4.7/sql-driver.html

Tottish
26th September 2010, 18:13
Thanks alot for that guide!
Followed the part on "How to build with minGW" (except that I have the complete install with the SDK and not only the sourcefiles) and when I run "mingw32-make sub-src" it starts working and continues for an hour or so and then this comes up:


g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
-DQT_MOC -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_TEXTCODEC -DQT_NO_CAST_FROM_AS
CII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT
-DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTST
REAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NODLL -I"
c:\MySQL\include" -I"." -I"." -I"..\..\..\include" -I"..\..\..\include\QtCore" -
I"..\..\..\include\QtXml" -I"..\..\xml" -I"..\..\..\mkspecs\win32-g++" -o releas
e\token.o token.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
-DQT_MOC -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_TEXTCODEC -DQT_NO_CAST_FROM_AS
CII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT
-DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTST
REAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NODLL -I"
c:\MySQL\include" -I"." -I"." -I"..\..\..\include" -I"..\..\..\include\QtCore" -
I"..\..\..\include\QtXml" -I"..\..\xml" -I"..\..\..\mkspecs\win32-g++" -o releas
e\main.o main.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -Wl,-s -Wl,-subsystem,console -mthreads -Wl -o ..\..\..\bin\moc.exe release/m
oc.o release/preprocessor.o release/generator.o release/parser.o release/token.o
release/main.o -L"c:\Qt\2010.05\qt\src\tools\bootstrap\release" -lbootstrap -l
user32 -lmysql -LC:\MySQL\lib\opt
c:/qt/2010.05/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe:
cannot find -lmysql
collect2: ld returned 1 exit status
mingw32-make[2]: *** [..\..\..\bin\moc.exe] Error 1
mingw32-make[2]: Leaving directory `c:/Qt/2010.05/qt/src/tools/moc'
mingw32-make[1]: *** [release] Error 2
mingw32-make[1]: Leaving directory `c:/Qt/2010.05/qt/src/tools/moc'
mingw32-make: *** [sub-moc-sub_src_target_ordered] Error 2


"cannot find -lmysql"
Have something gone wrong with the INCLUDEPATH-stuff or what? What is -lmysql exactly? A file?

************************************************** ******

When I follow what's under "How to Build the QMYSQL Plugin on Windows" I first (when running qmake) get:


c:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=C:\MySQL\inclu
de" "LIBS+=C:\MYSQL\lib\opt\libmysql.lib" mysql.pro
WARNING: (internal):1: Unescaped backslashes are deprecated.
WARNING: (internal):1: Unescaped backslashes are deprecated.
WARNING: (internal):1: Unescaped backslashes are deprecated.

Do I have to do something about that? What does it mean? I need backslashes to describe the path, don't I?

And when I run nmake I get:


g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_S
UPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_S
QL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..
\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\MySQL\include" -I"c:\MySQL\i
nclude" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..
\mkspecs\win32-g++" -o tmp\obj\debug_shared\main.o main.cpp
C:\Qt\2010.05\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CA
ST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_
LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\Qt
Sql" -I"..\..\..\..\include" -I"c:\MySQL\include" -I"c:\MySQL\include" -I"..\..\
..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\win32-g+
+" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.cpp -o tmp\moc\debug
_shared\qsql_mysql.moc
C:\Qt\2010.05\qt\bin\moc.exe är inte ett internt kommando, externt kommando,
program eller kommandofil.
NMAKE : fatal error U1077: 'C:\Qt\2010.05\qt\bin\moc.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\bin\nmake.exe"' : return code '0x2'
Stop.

and sure enough, there is no moc.exe in the Qt\bin folder. Is that wrong?

This is tricky! But I guess we're all n00bs in the beginning! =)
Extremely grateful for fast help!

Have a good one!
/Tottish

Tottish
29th September 2010, 09:46
OK, so I'm trying to follow the "How to build the MySQL driver for MinGW users" on another system (XP SP3) and I actually get past the step "mingw32-make sub-src" though it took a good 14 hours. But instead I get stuck on the next step where I try to qmake the mysql drivers.
This is what I get:

C:\Qt\4.6.2\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=C:\MySQL\MySQL51\in
clude" "LIBS+=-L. mysql" mysql.pro
WARNING: (internal):1: Unescaped backslashes are deprecated.
WARNING: (internal):1: Unescaped backslashes are deprecated.
WARNING: (internal):1: Unescaped backslashes are deprecated.
And the .dll's and .a's do not show up in the specified folder. I tried searching but they are nowhere to be found.

So what's wrong here? Again I ask what the warnings mean? Why don't I get an error if the drivers are not made?

Would be extremely grateful for some help on this one... I'm Totally confused.
Cheers
/Tottish

Tottish
29th September 2010, 14:42
Yippie!
Manged to create the dlls with nmake. Running smooth now!
Thanks for your support!
/Tottish