Qt linking

So I made a simple qt app and it runed fine when it compiled it, but when I dbclicked executable file it said it can't run because it can't find libgcc_s_dw2-1.dll
Then I searced it online and found that it should be somehow linked, but since I didn't know how to link it I just copypasted it from my qt bin folder but now it says it can't run because he can't find libstdc++-6.dll which I couldn't find in C:\Qt folder.

So my question is how to link those 2 things so I when I finish my tic tac toe I could show it to few guys?
These are MinGW libraries, so search them in your compiler folder.
When your application is finished, you should stick the EXE file in a folder by itself, and then all the required DLLs, like libgcc_s_dw2-1.dll, also. You can use the Dependency Walker program to see the names of all the DLLs you need to copy into the folder.
http://www.dependencywalker.com/

You do not need to copy any Windows DLLs out of system32.

Once done, zip up the folder and send the zip to your friends.

Good luck!
Isn't there a way to somehow link those files when compileing so I don't have to send the dll every time?
Last edited on
DLL = Dynamic link library
An exe file without dll does not work. you can copy that dll to system32 in installation process.
By the way libgcc_s_dw2-1.dll comes with MINGW (I believe
it comes with MINGW version 4.6x) - You will find it in the MINGW bin directory.
(QT related DLLs are in the QT directory)
Sorry to respond late. Don't stick your application's DLLs in system32. Stick them in the same folder that the user puts your application. You get this automatically if you just zip everything up the way I explained.
But in that case you will have repeated dlls for every program that uses qt.
¿what's the point on using dynamic linking then?
closed account (D80DSL3A)
Isn't there a way to somehow link those files when compileing so I don't have to send the dll every time?

Yes. You can link to the static versions (as I recently learned).

In Code::Blocks add this to: Project -> Build Options->Linker Settings -> other linker options

-static-libgcc
-static-libstdc++

Then provide a path to (or copy of) libgcc.a and libstdc++.a
I found these files in MinGW\lib\gcc\mingw32\4.5.2 on my system.
Yes, but that requires that Qt itself to be compiled the same way.

@OP could see that dll missing because Qt requires it, not necesary his application.
Last edited on
Topic archived. No new replies allowed.