Results 1 to 5 of 5

Thread: Can't build Qt with MySQL

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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

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

    Tottish (26th September 2010)

  3. #2
    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.

  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

    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

  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

    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.