CLion编译的exe文件离开IDE就不能运行

时间:2017-03-25 22:30:58   收藏:0   阅读:1465

The program cannot start because libgcc_s_dw2-1.dll is missing from

your computer. Try reinstalling the program to fix this problem

技术分享

原因:使用CLion编译的程序是用cmake方法编译的,在windows上exe文件需要libgcc才能运行

解决方法

修改CMAKElist文件,添加让链接器静态链接libgcc和libstdc++的指令

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

程序便可以执行

原文:http://www.cnblogs.com/liutianchen/p/6618704.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!