Make a executable file?

I know you can access the .exe file in the debug directory, but is there a way to make a .exe file that can run in cmd without needing to copy libstdc++-6.dll into the same directory?

Running Windows 10 and Clion 1.1.1.

1 comment
Comment actions Permalink

Hi Matthew!

Please try to use the following CMake command which sets the linker flags to link statically with libstdc++ and libgcc:

set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")

It requires not too old gcc version (4.7 or newer I believe).


Please sign in to leave a comment.