CLion 中的“CMake 测试失败并出现错误”

CLion 中的“CMake 测试失败并出现错误”

每次我尝试在 CLion 中构建项目时,无论使用什么工具链,都会出现此错误:

在此处输入图片描述

    -- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gcc.exe
-- Check for working C compiler: C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gcc.exe -- broken
CMake Error at C:/Program Files/JetBrains/CLion 2019.2.2/bin/cmake/win/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gcc.exe"

    is not able to compile a simple test program.

   It fails with the following output:

    Change Dir: C:/Users/Víctor/AppData/Local/Temp/cmake_check_environment/_build17193828646428762434/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/PROGRA~2/MINGW-~1/I686-8~1.0-P/mingw32/bin/mingw32-make.exe cmTC_60a1a/fast 
    C:/PROGRA~2/MINGW-~1/I686-8~1.0-P/mingw32/bin/mingw32-make.exe -f CMakeFiles\cmTC_60a1a.dir\build.make CMakeFiles/cmTC_60a1a.dir/build
    mingw32-make.exe[1]: Entering directory 'C:/Users/V�ctor/AppData/Local/Temp/cmake_check_environment/_build17193828646428762434/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_60a1a.dir/testCCompiler.c.obj
    C:\PROGRA~2\MINGW-~1\I686-8~1.0-P\mingw32\bin\gcc.exe    -o CMakeFiles\cmTC_60a1a.dir\testCCompiler.c.obj   -c C:\Users\Víctor\AppData\Local\Temp\cmake_check_environment\_build17193828646428762434\CMakeFiles\CMakeTmp\testCCompiler.c
    gcc.exe: error: C:\Users\Víctor\AppData\Local\Temp\cmake_check_environment\_build17193828646428762434\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or directory
    gcc.exe: fatal error: no input files
    compilation terminated.
    mingw32-make.exe[1]: *** [CMakeFiles\cmTC_60a1a.dir\build.make:65: CMakeFiles/cmTC_60a1a.dir/testCCompiler.c.obj] Error 1
    mingw32-make.exe[1]: Leaving directory 'C:/Users/V�ctor/AppData/Local/Temp/cmake_check_environment/_build17193828646428762434/CMakeFiles/CMakeTmp'
    mingw32-make.exe: *** [Makefile:120: cmTC_60a1a/fast] Error 2




  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/Víctor/AppData/Local/Temp/cmake_check_environment/_build17193828646428762434/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Víctor/AppData/Local/Temp/cmake_check_environment/_build17193828646428762434/CMakeFiles/CMakeError.log".

Error code: 1

我认为可能是因为路径 (í) 中有非 ASCII 字符,但我不确定。"C:/Users/Víctor/AppData/Local/Temp/cmake_check_environment/_build17193828646428762434/CMakeFiles/CMakeError.log"我的电脑中不存在该路径,因此无法检索错误日志。

相关内容