Results 1 to 5 of 5

Thread: Can't build Qt with MySQL

  1. #1
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Can't build Qt with MySQL

    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

    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:


    Qt Code:
    1. g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    2. oc -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\2010.02.1\qt\lib\libQtWebKitd4.a
    3. -o ..\..\..\..\lib\QtWebKitd4.dll object_script.QtWebKitd.Debug -L"c:\Qt\2010.
    4. 02.1\qt\lib" -L"c:\Qt\2010.02.1\qt\lib" obj\debug\QtWebKitd_resource_res.o -lwin
    5. mm -lgdi32 -luser32 -lwinmm -ladvapi32 -lgdi32 -lshell32 -lshlwapi -luser32 -lve
    6. rsion -lphonond4 -lQtXmlPatternsd4 -lQtGuid4 -lQtNetworkd4 -lQtCored4
    7. Creating library file: c:\Qt\2010.02.1\qt\lib\libQtWebKitd4.a
    8. ./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHandler.cpp:(.text+0x5a): undefi
    9. ned reference to `vtable for WebCore::FormDataIODevice'
    10. ./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHandler.cpp:(.text+0x12c): undef
    11. ined reference to `vtable for WebCore::FormDataIODevice'
    12. ./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHandler.cpp:(.text+0x1f1): undef
    13. ined reference to `vtable for WebCore::FormDataIODevice'
    14. ./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHandler.cpp:(.text+0x293): undef
    15. ined reference to `vtable for WebCore::FormDataIODevice'
    16. ./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHandler.cpp:(.text+0x335): undef
    17. ined reference to `vtable for WebCore::FormDataIODevice'
    18. ./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHandler.cpp:(.text+0x820): undef
    19. ined reference to `vtable for WebCore::QNetworkReplyHandler'
    20. ./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHandler.cpp:(.text+0xa9e): undef
    21. ined reference to `vtable for WebCore::QNetworkReplyHandler'
    22. ./obj\debug\QNetworkReplyHandler.o:QNetworkReplyHandler.cpp:(.text+0xd22): undef
    23. ined reference to `WebCore::QNetworkReplyHandler::processQueuedItems()'
    24. ./obj\debug\FrameLoaderClientQt.o:FrameLoaderClientQt.cpp:(.text+0x314b): undefi
    25. ned reference to `QWebPage::unsupportedContent(QNetworkReply*)'
    26. ./obj\debug\FrameLoaderClientQt.o:FrameLoaderClientQt.cpp:(.text+0x425e): undefi
    27. ned reference to `QWebPage::downloadRequested(QNetworkRequest const&)'
    28. collect2: ld returned 1 exit status
    29. mingw32-make[2]: *** [..\..\..\..\lib\QtWebKitd4.dll] Error 1
    30. mingw32-make[2]: Leaving directory `C:/Qt/2010.02.1/qt/src/3rdparty/webkit/WebCo
    31. re'
    32. mingw32-make[1]: *** [debug-all] Error 2
    33. mingw32-make[1]: Leaving directory `C:/Qt/2010.02.1/qt/src/3rdparty/webkit/WebCo
    34. re'
    35. mingw32-make: *** [sub-webkit-sub_src_target_ordered] Error 2
    36.  
    37. C:\Qt\2010.02.1\qt>cd src\plugins\sqldrivers\mysql
    To copy to clipboard, switch view to plain text mode 


    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
    Last edited by Tottish; 25th September 2010 at 10:55. Reason: bettter title and one more comment

  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: Can't build Qt with MySQL

    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

  3. The following user says thank you to tbscope for this useful post:

    Tottish (26th September 2010)

  4. #3
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't build Qt with MySQL

    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:

    Qt Code:
    1. g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
    2. -DQT_MOC -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_TEXTCODEC -DQT_NO_CAST_FROM_AS
    3. CII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT
    4. -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTST
    5. REAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NODLL -I"
    6. c:\MySQL\include" -I"." -I"." -I"..\..\..\include" -I"..\..\..\include\QtCore" -
    7. I"..\..\..\include\QtXml" -I"..\..\xml" -I"..\..\..\mkspecs\win32-g++" -o releas
    8. e\token.o token.cpp
    9. g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
    10. -DQT_MOC -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_TEXTCODEC -DQT_NO_CAST_FROM_AS
    11. CII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT
    12. -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTST
    13. REAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NODLL -I"
    14. c:\MySQL\include" -I"." -I"." -I"..\..\..\include" -I"..\..\..\include\QtCore" -
    15. I"..\..\..\include\QtXml" -I"..\..\xml" -I"..\..\..\mkspecs\win32-g++" -o releas
    16. e\main.o main.cpp
    17. g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    18. oc -Wl,-s -Wl,-subsystem,console -mthreads -Wl -o ..\..\..\bin\moc.exe release/m
    19. oc.o release/preprocessor.o release/generator.o release/parser.o release/token.o
    20. release/main.o -L"c:\Qt\2010.05\qt\src\tools\bootstrap\release" -lbootstrap -l
    21. user32 -lmysql -LC:\MySQL\lib\opt
    22. c:/qt/2010.05/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe:
    23. cannot find -lmysql
    24. collect2: ld returned 1 exit status
    25. mingw32-make[2]: *** [..\..\..\bin\moc.exe] Error 1
    26. mingw32-make[2]: Leaving directory `c:/Qt/2010.05/qt/src/tools/moc'
    27. mingw32-make[1]: *** [release] Error 2
    28. mingw32-make[1]: Leaving directory `c:/Qt/2010.05/qt/src/tools/moc'
    29. mingw32-make: *** [sub-moc-sub_src_target_ordered] Error 2
    To copy to clipboard, switch view to plain text mode 

    "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:

    Qt Code:
    1. c:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=C:\MySQL\inclu
    2. de" "LIBS+=C:\MYSQL\lib\opt\libmysql.lib" mysql.pro
    3. WARNING: (internal):1: Unescaped backslashes are deprecated.
    4. WARNING: (internal):1: Unescaped backslashes are deprecated.
    5. WARNING: (internal):1: Unescaped backslashes are deprecated.
    To copy to clipboard, switch view to plain text mode 

    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:

    Qt Code:
    1. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_S
    2. UPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_S
    3. QL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..
    4. \..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\MySQL\include" -I"c:\MySQL\i
    5. nclude" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..
    6. \mkspecs\win32-g++" -o tmp\obj\debug_shared\main.o main.cpp
    7. C:\Qt\2010.05\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CA
    8. ST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_
    9. LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\Qt
    10. Sql" -I"..\..\..\..\include" -I"c:\MySQL\include" -I"c:\MySQL\include" -I"..\..\
    11. ..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\win32-g+
    12. +" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.cpp -o tmp\moc\debug
    13. _shared\qsql_mysql.moc
    14. C:\Qt\2010.05\qt\bin\moc.exe är inte ett internt kommando, externt kommando,
    15. program eller kommandofil.
    16. NMAKE : fatal error U1077: 'C:\Qt\2010.05\qt\bin\moc.exe' : return code '0x1'
    17. Stop.
    18. NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 9.0\
    19. VC\bin\nmake.exe"' : return code '0x2'
    20. Stop.
    To copy to clipboard, switch view to plain text mode 

    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
    Last edited by Tottish; 26th September 2010 at 18:30.

  5. #4
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't build Qt with MySQL

    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:
    Qt Code:
    1. C:\Qt\4.6.2\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=C:\MySQL\MySQL51\in
    2. clude" "LIBS+=-L. mysql" mysql.pro
    3. WARNING: (internal):1: Unescaped backslashes are deprecated.
    4. WARNING: (internal):1: Unescaped backslashes are deprecated.
    5. WARNING: (internal):1: Unescaped backslashes are deprecated.
    To copy to clipboard, switch view to plain text mode 
    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

  6. #5
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't build Qt with MySQL

    Yippie!
    Manged to create the dlls with nmake. Running smooth now!
    Thanks for your support!
    /Tottish

Similar Threads

  1. Replies: 1
    Last Post: 13th January 2010, 23:35
  2. Can not build Qt 4.6.
    By steve_smith in forum Installation and Deployment
    Replies: 1
    Last Post: 12th January 2010, 15:03
  3. Moving from QT 4.5 shared build to QT 4.5.2 static build
    By extrakun in forum Qt Programming
    Replies: 0
    Last Post: 26th October 2009, 09:49
  4. Qt build
    By semden in forum Newbie
    Replies: 1
    Last Post: 2nd October 2008, 17:17
  5. Replies: 3
    Last Post: 28th December 2007, 11:02

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
  •  
Qt is a trademark of The Qt Company.