PDA

View Full Version : libgcc_s_dw2-1.dll?



FS Lover
15th December 2009, 16:02
apparently this new dll is added in the latest version of Qt.
what is it? what does it do?
and what about changes in static linking procedure etc.

squidge
15th December 2009, 17:39
apparently ? So you don't know for sure ?

Since it starts "libgcc", I'd say it's part of a newer version of GCC that is used. Other than that, there will be no other changes, no changes to static linking, etc.

FS Lover
15th December 2009, 19:11
I mean from static fully static.
for example mingwm10.dll that isn't part of Qt itself is not linked statically when linking Qt statically (but we can make it static too of course).
probably the option that makes mingwm10.dll linked statically would make libgcc_s_dw2-1.dll so too.

FS Lover
15th December 2009, 19:18
apparently ? So you don't know for sure ?
...
I am unsure about everything :D
it causes no harm often, and at least is better than false assurance.

squidge
15th December 2009, 20:07
mingwm10.dll isn't part of GCC as such as you can easily build GCC without it (You can, for example, use Cygwin instead).

A quick google turns up this:

"Dynamic linking with libgcc_s_dw2-1.dll is necessary to throw exceptions between different modules, such as between two DLLs or a DLL and an EXE. Consequently, it is the default for all languages other than C. To disable this dynamic linking, use -static-libgcc. To enable this dynamic linking in C, use -shared-libgcc."

FS Lover
16th December 2009, 06:14
how to pass that option to Qt's build system?

squidge
16th December 2009, 08:01
I don't use GCC, but MSVC, so I've no idea. I would expect CPPFLAGS or similar however.

Is it really a problem for you however? Have you actually tried to deploy an app without that library to see if it still functions?

FS Lover
16th December 2009, 13:34
Have you actually tried to deploy an app without that library to see if it still functions?
yes, it's needed.
but I didn't attempt to make a fully static executable yet (but I did with prior versions of Qt without this new dll).
libgcc_s_dw2-1.dll is not a problem, and is small; but I am very curious and want to know everything before encountering.

Eos Pengwern
23rd December 2009, 21:35
I just installed Qt4.6 and I'm finding that although my application compiles and runs perfectly well from within Qt Creator, if I try to run it from outside (i.e. by clicking on the executable) then I get the "libgcc_s_dw2-1.dll was not found" error.

I downloaded the missing file (which wasn't trivial - you have to fetch down gcc-core-4.4.0-mingw32-dll.tar.gz from SourceForge, and extract the needed file from it) and put it in the same directory as my executable, and the error went away.

It would be great if someone at Qt could add the file to the official Qt4.6 release - it would certainly have saved a lot of time today.

Stephen.

squidge
23rd December 2009, 22:19
If your application compiles and runs perfectly well from within Qt Creator, then you already have the libgcc_s_dw2-1.dll, otherwise it wouldnt run :)

What you'll probably find is that your system path setup is incorrect, so the OS can't find the file when you quit Qt Creator.

Eos Pengwern
24th December 2009, 09:41
You're right, I found it in my C:\Qt\2009.05\qt\bin directory, while looking for it manually; an earlier Vista file search had failed to locate it.

christophe
15th January 2010, 10:33
how to pass that option to Qt's build system?

You can pass that option with QMAKE_LFLAGS.

With the command line:

qmake QMAKE_LFLAGS+=-static-libgcc -config release

Or adding QMAKE_LFLAGS+=-static-libgcc in your .pro file.

schnitzel
26th January 2010, 00:35
You can pass that option with QMAKE_LFLAGS.

With the command line:

qmake QMAKE_LFLAGS+=-static-libgcc -config release

Or adding QMAKE_LFLAGS+=-static-libgcc in your .pro file.

I am seeing this now too all of a sudden after installing the latest Windows Qt SDK 2010.01. Qt configured to dynamic linking, i.e. no change since installation.

I tried the suggested QMAKE_LFLAGS but that was a nogo.

Does this mean I have to add this dll to my installer? If so, then shouldn't this be mentioned in the Application Dependencies on this page:
http://doc.qt.nokia.com/4.6/deployment-windows.html

schnitzel
26th January 2010, 20:01
found this:
http://marc.info/?l=mingw-users&w=2&r=2&s=libgcc_s_dw2-1.dll&q=b
look under 'General Notes' in the first post of that thread.

Deployed apps work after adding this dll, but is it ok for me to distribute it??????

schnitzel
27th January 2010, 20:06
this dependency doesn't seem to exist in Qt 4.5.3, so I'm going back to that.

squidge
27th January 2010, 20:44
It's part of GCC, not Qt, and yes, it's OK for you to distribute it under the terms of the LGPL. You can also use the linker option "-static-libgcc" to remove the need for the library.

Or, you can use an older version of MinGW. There's no need to use an older version of Qt.

schnitzel
28th January 2010, 01:06
It's part of GCC, not Qt, and yes, it's OK for you to distribute it under the terms of the LGPL. You can also use the linker option "-static-libgcc" to remove the need for the library.

Or, you can use an older version of MinGW. There's no need to use an older version of Qt.

My app uses qextserialport, so I rebuilt that with the linker flag. Also I rebuilt my app with the linker flag. Unfortunately, it still complains about the libgcc_s_dw2-1.dll.
When I run depends, the missing dll shows up inside the tree for QtGUI.dll and QtCore4.dll. Does this mean I have to reconfigure Qt with the new linker flag?

schnitzel
30th January 2010, 01:30
It's part of GCC, not Qt, and yes, it's OK for you to distribute it under the terms of the LGPL.

according to the discussion in this link it might not be ok:
http://old.nabble.com/distributing-LIBGCC_S_DW2-1.DLL-td25342619.html



You can also use the linker option "-static-libgcc" to remove the need for the library.

Still haven't made any progress on this, I tried several times no luck.

squidge
30th January 2010, 10:03
Yes, you would need to rebuild Qt too for this to work, as that also uses the library.