Clion MinGW之The C compiler "MinGW/bin/gcc.exe" is not able to compile a simple test program.

在安装Clion后配置MinGW环境时,gcc.exe显示有错误。

查看到类似以下内容(当时忘记记录了,这是某位提问者的提示):



    -- The C compiler identification is unknown
    -- The CXX compiler identification is unknown
    -- Check for working C compiler: C:/MinGW/bin/gcc.exe
    CMake Error: Generator: execution of make failed. Make command was: "C:/MinGW/bin/mingw32-make.exe" "cmTC_87f99/fast"
    -- Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken
    CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
    The C compiler

    "C:/MinGW/bin/gcc.exe"

    is not able to compile a simple test program.

    It fails with the following output:

    Change Dir: C:/Users/鍙惰惤鐭ョ/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeTmp

    Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTC_87f99/fast"
    Exit code 0xc0000135

    Generator: execution of make failed. Make command was: "C:/MinGW/bin/mingw32-make.exe" "cmTC_87f99/fast"

    CMake will not be able to correctly generate this project.
    Call Stack (most recent call first):
    CMakeLists.txt:1 (project)

    -- Configuring incomplete, errors occurred!
    See also "C:/Users/鍙惰惤鐭ョ/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeOutput.log".
    See also "C:/Users/鍙惰惤鐭ョ/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeError.log".

    Error code: 1

注意到MinGW的安装目录是英文的,但由于系统用户名是中文的,所以cmake_check_environment的路径上出现了乱码

首先试图更改cmake_check_environment的路径,使其不含中文,无果,并未找到相关信息。

在刚买电脑时知识储备不足,写了中文系统用户名,安装了许多IDE和SQL之后又不敢轻易改名。

今天大胆地试了一下将系统用户名改为英文,Clion的问题解决了,暂时未发现其他软件无法使用。

重新自动检测make、c compiler、c++ compiler的时间可能长一点,请耐心等待。

Clion MinGW之The C compiler

改系统名可参照此篇,建议在其他设备上看,因为改名时电脑是无法看到了,小心地一步一步做,即可成功。

https://blog.csdn.net/weixin_42465260/article/details/83758312

你可能感兴趣的:(安装问题,clion,MinGW,c,gcc,cmake)