Reason : The program compiled with CLion is compiled with the cmake method, and the exe file on windows needs libgcc to run
Error:
Modify the CMAKElist file, add:
set(CMAKE_EXE_LINKER_FLAGS "-static")
Or add: Modify the CMAKElist file and add instructions for the linker to statically link libgcc and libstdc++
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
or add:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
or add:
set(CMAKE_EXE_LINKER_FLAGS "-static")
As shown in the picture: