问题复现
依据网络上的方法安装MinGW installer后配置也成功,但新建项目生成CMake时会报错。
Error:The C compiler “C:/MinGW/bin/gcc.exe” is not able to compile a simple test program.
官方解决办法没太看明白,尝试做了但没效果。
We suppose that it’s not CLion problem, but problem with using CMake + MinGW, because they don’t support non-latin symbols.To solve the problem you can
1) change usage of MinGW to Cygwin or
2) сhange idea.system.path in the IDE_HOME\bin\idea.properties file so it won’t contain non-latin symbols (please see https://intellij-support.jetbrains.com/entries/23358108 and https://www.jetbrains.com/idea/help/project-and-ide-settings.html for more details).
Also we have an article in our web help about configuring CLion on Windows:https://www.jetbrains.com/help/clion/2016.1/quick-tutorial-on-configuring-clion-on-windows.html.
解决办法
可以按官方说的安装Cygwin,我自己安装过,确定可以解决。不过安装麻烦,下载慢。推荐安装MinGW64 离线的方式,MinGW64离线,下载下来直接解压到一个目录,然后配置注意要到最内层的mingw就可以了。
update:2018/1/15 其中可以用tdm64-gcc-5.1.0-2.exe来安装,比较新,聪明的你直接复制关键字肯定能找到,可能有更新的版本哦!