Plain C++ project dependency issue



  • Hello.

    I am writing a simple application to connect to an IRC server in order to practice but I found out an issue that annoys me. I compiled the project (Plain C++ project) with MingGW compiler but I realised that in order to run the output I either need to build it statically or I need to install several dlls on my system.

    Is there any way I can work this around? Some of the missing libraries are libgcc_s_dw2-1.dll and libwinpthread-1.dll. I do not want my potential users to install additional items and a static build increases the size of the file way more than my likings.

    Do those files come with any C++ redistributable or something? Any information would be quite welcome.

    Thanks a lot!


  • Moderators

    Hi, and welcome to the Qt Dev Net!

    @Codehack said:

    I compiled the project (Plain C++ project) with MingGW compiler but I realised that in order to run the output I either need to build it statically or I need to install several dlls on my system.

    That's happens with all C++ projects.

    Is there any way I can work this around? Some of the missing libraries are libgcc_s_dw2-1.dll and libwinpthread-1.dll. I do not want my potential users to install additional items and a static build increases the size of the file way more than my likings.

    Do those files come with any C++ redistributable or something?

    • If your application is built with MinGW, your users would need libgcc_s_dw2-1.dll and libwinpthread-1.dll (and don't forget libstdc++-6.dll).
    • If your application is built with Visual Studio 2013, your users would need msvcr120.dll and msvcp120.dll instead.

    The difference is that you can ask your users to download and install "Visual C++ Redistributable" to satisfy the Visual Studio dependencies, but there's no installer for the MinGW dependencies

    However, you don't need to ask your users to install anything extra. Simply provide the DLLs in the same folder as your application executable.



  • So, I guess that compiling my project with MSVC compiler on Qt Creator will make the application dependant to msvcr120.dll and msvcp120.dll or it only applies for Visual Studio-built programs?



  • The executable is independent form the IDE used, but it requires libraries from compiler.

    So the answer is, YES you need to deploy msvc*120.dll to the target machine


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.