PDA

View Full Version : how to build static application with MinGw?



mismael85
24th February 2008, 19:11
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?:confused:

jpn
24th February 2008, 19:24
Please, search the forums before starting new threads. See Qt Centre wiki: Building static Qt on Windows.

mismael85
24th February 2008, 21:39
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????

jpn
24th February 2008, 21:47
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).

mismael85
24th February 2008, 21:58
thank you i will build it again.

mismael85
28th February 2008, 13:26
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?

pherthyl
28th February 2008, 17:16
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.

mismael85
28th February 2008, 22:58
thank you i will try

anhdepyeu
4th March 2008, 17:59
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 (http://sourceware.org/ml/pthreads-win32/2000/msg00141.html):


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/message.php?msg_name=1DEA4785-AF00-4E9A-BA26-72DE39B602DD%40gmail.com

mismael85
11th March 2008, 20:45
thank you every body , Qt must be reconfigured and i did that and my programs are fully static