I’ve compiled a C++ program and it’s perfectly working on my computer, but if my friend tries to launch the program, it says libgcc_s_sw2-1.dll is missing. How I can include all the required GCC runtime libraries with the program using CMake?
I’ve compiled a C++ program and it’s perfectly working on my computer, but if
Share
As rubenvb correctly answers: libgcc is required or you should add
CMAKE_EXE_LINKER_FLAGS=-staticto your CMakeLists.txt.As an alternative, you could try to find libgcc_s_sw2-1.dll in your MinGW installation and “package” it with your installation using InstallRequiredSystemLibraries. This integrates nicely with CPack as well.
E.g. in my own code, I have:
Later on, in the part which prepares an install or package: