Results 1 to 10 of 10

Thread: how to build static application with MinGw?

  1. #1
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Question how to build static application with MinGw?

    hello everybody,
    i build my Qt applications static using MinGw but there is a dll that must be exist
    which is MinGwM10.dll
    i am already have static version of Qt.
    how can i kill MingwM10.dll dependency?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: how to build static application with MinGw?

    Please, search the forums before starting new threads. See Qt Centre wiki: [WIKI]Building static Qt on Windows[/WIKI].
    J-P Nurmi

  3. #3
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to build static application with MinGw?

    excuse me but i did just as described in the wiki i am using MinGw
    so i changed mkspecs win32-g++ from
    QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc

    to

    QMAKE_LFLAGS = -static -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc

    and i add in my *.pro file the line
    config = static

    and My Qt version is built static using the following configuration
    configure -static -release -platform win32-g++

    after all that when i built my application and try to execute it on different machine a message appears says that the application need mingwm10.dll
    what is my wrong????

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: how to build static application with MinGw?

    Did you also rebuild Qt after modifying mkspecs? On wiki, modifying mkspecs is advised as one of the steps before building Qt. Your current version of Qt depends on mingwm10.dll. You have to rebuild Qt without the dependency (now that you have modified mkspecs).
    J-P Nurmi

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

    mismael85 (24th February 2008)

  6. #5
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to build static application with MinGw?

    thank you i will build it again.

  7. #6
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to build static application with MinGw?

    i built Qt as follows after i changed the mkspecs as follows
    from:
    QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
    to:
    QMAKE_LFLAGS = -static -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
    i opend the cmd and wrote the following command:
    mingw32-make
    i toke about 5 hours
    and then i built my program and executed it in another machine and it said thet it needs mingwm10.dll
    what is the problem?

  8. #7
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to build static application with MinGw?

    Did you reconfigure qt? I see you already had Qt configured for -static, but maybe it needs a reconfigure after changing the mkspecs. Perhaps a make conf-clean and reconfigure would help... Otherwise I don't know. The instructions worked for me..


    Oh wait. You need to use the parameter -no-exceptions when you configure Qt, try that and rebuild Qt and your app.

  9. #8
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to build static application with MinGw?

    thank you i will try

  10. #9
    Join Date
    Aug 2007
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to build static application with MinGw?

    Quote Originally Posted by pherthyl View Post
    You need to use the parameter -no-exceptions when you configure Qt, try that and rebuild Qt and your app.
    This presupposes that you aren't using exceptions. If you are, and you are using threads (which I believe is unavoidable for Qt GUI apps), then so far as I can see just from a little googling, you cannot eliminate the dependency on mingwm10.dll -- here is a (perhaps out-of-date, from 2000) possible explanation of why from (the pthreads-win32 list:
    The mingwm10 must be build as a dll, because it use features the from
    DllMain (thread detach ) to cleanup eh after thread termination (free some
    memory).
    Nonetheless, it seems there may be some ongoing efforts to create a work-around for this:
    http://sourceforge.net/mailarchive/m...DD%40gmail.com

  11. #10
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to build static application with MinGw?

    thank you every body , Qt must be reconfigured and i did that and my programs are fully static

Similar Threads

  1. Replies: 16
    Last Post: 23rd May 2008, 11:12
  2. Windows XP Qt 4.3.2 Static build
    By maxpower in forum Installation and Deployment
    Replies: 9
    Last Post: 2nd November 2007, 05:49
  3. Qt4 MacOSX UB Xcode and a static Qt build?
    By kuroyume0161 in forum Installation and Deployment
    Replies: 15
    Last Post: 18th March 2007, 09:10
  4. problem after Qt 4.2.2 static build
    By npc in forum Newbie
    Replies: 2
    Last Post: 23rd February 2007, 13:28
  5. Replies: 0
    Last Post: 21st February 2006, 17:30

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.