Results 1 to 13 of 13

Thread: install qt + mysql on windows xp

  1. #1
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default install qt + mysql on windows xp

    Hello,

    For some reason I am not allowed to post in the section 'installation and deployment' so I am asking here.
    For installing qt on xp I am trying to follow this guide:
    http://wiki.qtcentre.org/index.php?t...ws_using_MinGW

    But on step 5, make returns an error:
    d:\Qt\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\ ..\mingw32\bin\ld.exe: cannot find -lQtSqld4
    collect2: ld returned 1 exit status
    mingw32-make[]: *** [..\..\..\..\plugins\sqldrivers\qsqlmysqld4.dll] Error 1

    Please help.

  2. #2
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install qt + mysql on windows xp

    Never mind, I was using the wrong guide.

  3. #3
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install qt + mysql on windows xp

    I'm lost and asking for help again.

    I am trying to compile a static qt 4.4.1 on windows xp with mingw and with mysql support.
    http://wiki.qtcentre.org/index.php?t..._Windows#MinGW

    The configure line was this:
    configure -static -no-execptions -qt-sql-mysql

    When I run mingw32-make it stops on mysql.h not found. Seems I need to download mysql source to compile. What exactly do I have to download and where do I put it?
    Isn't there a howto or a tutorial on this? There are some for the plugin version but I'd like static builds.

    Thanks.

    Edit: I found a guide http://www.rag.com.au/linux/qt4howto.html and trying out now.
    Last edited by JeanC; 12th September 2008 at 08:22.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install qt + mysql on windows xp

    You didn't tell Qt where it should look for MySQL library. You have to pass -I and -L options with proper arguments to configure.

  5. #5
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install qt + mysql on windows xp

    Yes I reconfigure/recompiled with those options.

    It didn't finish the compile (which took about 10 hours). It had an error compiling one of the very last examples, but qt itself is installed.

    It still asks for libmysql.dll though.

    But there are two other things much more to my dislike.

    1. All exe files are around 10 mb, is that normal? Seems a bit huge.
    2. If I start my first compiled own program (a port from working unix code) first I get a windows cmd window, then the program starts.

    Strange..

    Quote Originally Posted by jacek View Post
    You didn't tell Qt where it should look for MySQL library. You have to pass -I and -L options with proper arguments to configure.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install qt + mysql on windows xp

    Quote Originally Posted by JeanC View Post
    It didn't finish the compile (which took about 10 hours). It had an error compiling one of the very last examples, but qt itself is installed.
    You have compiled static Qt with examples? You must have a lot of disk space. Next time compile just the library and plugins and make sure you pass the "-release" option to the configure.

    Quote Originally Posted by JeanC View Post
    It still asks for libmysql.dll though.
    Most likely because you didn't provide a static version of that library.

    Quote Originally Posted by JeanC View Post
    1. All exe files are around 10 mb, is that normal? Seems a bit huge.
    Try stripping the binaries.

    Quote Originally Posted by JeanC View Post
    2. If I start my first compiled own program (a port from working unix code) first I get a windows cmd window, then the program starts.
    Do you have CONFIG += console in your .pro file?

  7. #7
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install qt + mysql on windows xp

    Quote Originally Posted by jacek View Post
    You have compiled static Qt with examples? You must have a lot of disk space. Next time compile just the library and plugins and make sure you pass the "-release" option to the configure.
    Yeah that harddisk is almost full now, have to write something to delete all those exe's.
    I didn't pass -release no, I will do that. This was my configure line: configure -platform win32-g++ -static -qt-sql-sqlite -qt-sql-mysql -l mysql -I d:\qt\mysql\include -L d:\qt\mysql\lib\opt

    Most likely because you didn't provide a static version of that library.
    And how would I do that please?

    Try stripping the binaries.
    What do you mean? How would I do that?

    Do you have CONFIG += console in your .pro file?
    [/quote]

    I use qdevelop for an IDE. Looking at the .pro there is indeed a console entry:
    Qt Code:
    1. CONFIG += qt \
    2. debug \
    3. warn_on \
    4. console \
    5. staticlib
    To copy to clipboard, switch view to plain text mode 

    One problem solved.

    3 questions:
    What is the configure line to just compile qt and plugins please? I really would like a static build but only if it gives me 'normal' sized exes.
    Will passing -release give me exes with a sane size?
    And how should I provide a static version of mysql?

    Hope to get this working..
    Thanks for the help jacek.

  8. #8
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install qt + mysql on windows xp

    Edit:

    I bet the command to compile source only is
    Qt Code:
    1. mingw32-make sub-src
    To copy to clipboard, switch view to plain text mode 

    But how do I provide a static version of mysql please?

  9. #9
    Join Date
    Dec 2007
    Posts
    129
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install qt + mysql on windows xp

    how about build the mysql plugin first then build the qt as static?

  10. #10
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install qt + mysql on windows xp

    You mean it will get linked in automagically?
    Hm, it says

    WARNING: Using static linking will disable the use of plugins.
    Make sure you compile ALL needed modules into the library.
    Last edited by JeanC; 13th September 2008 at 16:27.

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install qt + mysql on windows xp

    Quote Originally Posted by JeanC View Post
    What do you mean? How would I do that?
    Use the "strip" utility. You can also consider something like UPX. But you can't expect that all of the Qt code will simply vanish just because you have used the static build.

    Quote Originally Posted by JeanC View Post
    Will passing -release give me exes with a sane size?
    No, but you will save a lot of disk space. You can use the dynamic linking for debugging.

    Quote Originally Posted by JeanC View Post
    And how should I provide a static version of mysql?
    You will have to consult the MySQL documentation, but beware that linking MySQL library into your executable might cause licensing problems.

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install qt + mysql on windows xp

    Quote Originally Posted by JeanC View Post
    Hm, it says

    WARNING: Using static linking will disable the use of plugins.
    Make sure you compile ALL needed modules into the library.
    Yes, you will have to use "static" plugins.

  13. #13
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install qt + mysql on windows xp

    I have rebuilt qt without static, mysql works.
    Thank you all for your help.

Similar Threads

  1. A Guide to Install MinGW, Qt4 and Eclipse Integration on Windows XP
    By shiyutang in forum Installation and Deployment
    Replies: 10
    Last Post: 5th August 2009, 04:03
  2. Embedded Mysql Windows Qt4.1
    By benguela in forum Qt Programming
    Replies: 7
    Last Post: 17th January 2007, 00:13
  3. Help to install Qt in Windows Xp
    By joseph in forum General Discussion
    Replies: 2
    Last Post: 15th November 2006, 09:40
  4. Connection to MySQL - windows
    By Peter34 in forum Qt Programming
    Replies: 18
    Last Post: 30th October 2006, 18:54
  5. Deploying with MySQL support under Windows
    By KShots in forum Installation and Deployment
    Replies: 1
    Last Post: 12th October 2006, 09:19

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.