Results 1 to 10 of 10

Thread: Windows XP Qt 4.3.2 Static build

  1. #1
    Join Date
    Oct 2006
    Posts
    60
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Windows XP Qt 4.3.2 Static build

    I am trying to build qt 4.3.2 in static mode. However, after I do so and run qmake on one of the example programs, the make process aborts because it cannot find -lqtcore4. I am certain that qtcore4 is only for shared programs. If I manually remove qtcore4 from the Makefile the program builds fine. Where is qmake getting the idea to use qtcore4? I have tried the various options to configure:

    -static -fast
    -static -fast -qt-sql-sqlite
    -static -fast -qt-sql-lite -qt-sql-mysql -I c:\mysql\include -L c:\mysql\lib\opt -L c:\mysql\lib\debug -l mysql
    -static -fast -qt-sql-lite -plugin-sql-mysql -I c:\mysql\include -L c:\mysql\lib\opt -L c:\mysql\lib\debug -l mysql

    I do want to have mysql support included. Any help would be greatly appreciated. At first I ran the make on qt all the way through however lately I have just been letting configure complete before trying qmake again. Do I have to let make on qt fully complete in order for it to understand not to use qtcore4?

    mAx

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Windows XP Qt 4.3.2 Static build

    What do you think you need instead QtCore??
    you have to recompile your complete qt src dir after configuring qt with --static

  3. #3
    Join Date
    Oct 2006
    Posts
    60
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Windows XP Qt 4.3.2 Static build

    I need QtCore not QtCore4. QtCore is static but QtCore4 is shared. I guess I will let Qt completely compile but I was hopeful that only qmake needed to be re-maked in order to drop the QtCore4 dependency.

    mAx

  4. #4
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Windows XP Qt 4.3.2 Static build

    Are you really sure there's no '4'?
    Please remove the *.prl - files in qt-4-src/lib or use a clean build to avoid using old prl files (they're like pkg-config files and contain informations about the filename and deps, ...)

  5. The following user says thank you to ChristianEhrlicher for this useful post:

    maxpower (16th October 2007)

  6. #5
    Join Date
    Oct 2006
    Posts
    60
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Windows XP Qt 4.3.2 Static build

    Quote Originally Posted by ChristianEhrlicher View Post
    Are you really sure there's no '4'?
    Please remove the *.prl - files in qt-4-src/lib or use a clean build to avoid using old prl files (they're like pkg-config files and contain informations about the filename and deps, ...)
    Thanks. Qt is still compiling but I ran qmake on examples/widgets/spinboxes and -lQtCore4 is gone from the Makefile! Deleting the prl seems to have done the trick.

    Thanks again
    mAx

  7. #6
    Join Date
    Oct 2006
    Posts
    60
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Windows XP Qt 4.3.2 Static build

    Spoke too soon. make on qt just bombed out looking for -lQtSql4 during the build of uic3. Now when I run qmake on the spinbox example it has -lQtCore4 again. How do I include mysql in a static build of Qt? I was trying -qt-sql-mysql but do I need to use -plugin-sql-mysql instead? I used these options to build Qt this time:


    configure.exe -static -fast -qt-sql-mysql -I c:\mysql\include -L c:\mysql\lib\opt -L c:\mysql\lib\debug -l mysql -qt-sql-sqlite

    Thanks
    mAx

    Edit: This link http://www.rag.com.au/linux/qt4howto.html does not use debug when building Qt in static mode. Is that what I am doing wrong? I am going to start compiling now to find out.

    Edit 2: That did not work. Arg!
    Last edited by maxpower; 16th October 2007 at 18:09. Reason: updated contents

  8. #7
    Join Date
    Oct 2006
    Posts
    60
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Windows XP Qt 4.3.2 Static build

    When the make gets to QtXml I can look at its prl file and see -lQtCore4 is included. What am I doing wrong so that Qt keeps wanting to link to a shared Qt lib on a static Qt build??

    mAx

  9. #8
    Join Date
    Oct 2006
    Posts
    60
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Windows XP Qt 4.3.2 Static build

    I have determined that this only happens when I include mysql in the build. Does this help anyone solve my problem?

    mAx

  10. #9
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Windows XP Qt 4.3.2 Static build

    Not really (at least not me)
    Maybe write a bug report to qt-bugs

  11. #10
    Join Date
    Jun 2006
    Posts
    64
    Thanks
    10
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Windows XP Qt 4.3.2 Static build

    maxpower,

    I suffered the same problem as you albeit on 2k. I solved it by doing this:

    1. install Qt 4.3.2 as a shared build. (I used c:\qt\4.3.2)
    2. copy the installed directory to a new directory (c:\qt\4.3.2-static)
    3. add c:\qt\4.3.2-static\lib and c:\qt\4.3.2-static\bin to your path
    4. rename c:\qt\4.3.2 to something else so it can't be found. (say c:\qt\old-4.3.2)
    5. delete the makefile in c:\qt\4.3.2-static
    6. run c:\qt\4.3.2-static\bin\qmake
    7. now run configure <---options---> and ming32-make.
    8. rename the shared build back to c:\qt\4.3.2

    You should with any luck have a working static build and shared build in separate directories.

    I didn't suffer these problems under Linux or using QT 4.2.3, only the windows version of QT 4.3.2. The rest of the instructions at http://www.rag.com.au/linux/qt4howto.html worked for me.

    I hope this helps,

    Regards, B1.

Similar Threads

  1. Replies: 16
    Last Post: 23rd May 2008, 10:12
  2. Build static on windows without deps on mingwm10.dll
    By ucomesdag in forum Qt Programming
    Replies: 2
    Last Post: 9th July 2007, 05:46
  3. Qt4 MacOSX UB Xcode and a static Qt build?
    By kuroyume0161 in forum Installation and Deployment
    Replies: 15
    Last Post: 18th March 2007, 08:10
  4. Replies: 10
    Last Post: 25th February 2007, 00:23
  5. problem after Qt 4.2.2 static build
    By npc in forum Newbie
    Replies: 2
    Last Post: 23rd February 2007, 12:28

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.