Windows,gccにおいて、cmakeがコンパイラの動作確認時にエラーを吐く
windows10(32bit), gcc-8.1.0, GNU make-3.81, cmake-3.12.1においてです。
私は、C:/Users/<username>/Google ドライブ/.emacs.d/etc/ にcmakeとmingw-w64
をインストールしています。~/
に.emacs.d
という名前でC:/Users/<username>/Google ドライブ/.emacs.d
へのシンボリックリンクを置いていて、シンボリックリンク経由でcmakeとmingw-w64、msysにPATHを通しています。関係のありそうな環境変数は次のような値になっています。
C=gcc
CMAKE_CXX_COMPILER=g++
CMAKE_C_COMPILER=gcc
CXX=g++
この環境で、https://m-tmatma.github.io/cmake/cmake-helloworld.html のmain.c, CmakeLists.txtをC:/Users/<username>/desktop/sample/
直下に置き、コマンドプロンプト上でこのディレクトリに移動したあと
cmake -G "MSYS Makefiles"
を実行しました。すると、次のようなエラー(?)を吐き、cmakeを正常に行なうことができません。文字化けしているのでそれが原因なのか、それとも他に原因があるのでしょうか。これを解決するにはどうしたらいいでしょうか。
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: C:/Users/<username>/AppData/Roaming/.emacs.d/etc/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/Users/<username>/AppData/Roaming/.emacs.d/etc/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Users/<username>/Google 繝峨Λ繧、繝 /.emacs.d/etc/CMake/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"C:/Users/<username>/AppData/Roaming/.emacs.d/etc/MinGW/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/<username>/Desktop/sample/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/<username>/AppData/Roaming/.emacs.d/etc/MinGW/msys/1.0/bin/make.exe" "cmTC_39024/fast"
/usr/bin/make -f CMakeFiles/cmTC_39024.dir/build.make CMakeFiles/cmTC_39024.dir/build
make[1]: Entering directory `/c/Users/<username>/Desktop/sample/CMakeFiles/CMakeTmp'
/bin/sh: /C/Users/<username>/Google 郢晏ウィホ帷ケァ 、郢昴 .emacs.d/etc/CMake/bin/cmake.exe: No such file or directory
make[1]: *** [CMakeFiles/cmTC_39024.dir/testCCompiler.c.obj] Error 127
make[1]: Leaving directory `/c/Users/<username>/Desktop/sample/CMakeFiles/CMakeTmp'
make: *** [cmTC_39024/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:10 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/<username>/Desktop/sample/CMakeFiles/CMakeOutput.log".
See also "C:/Users/<username>/Desktop/sample/CMakeFiles/CMakeError.log".
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: C:/Users/<username>/AppData/Roaming/.emacs.d/etc/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/Users/<username>/AppData/Roaming/.emacs.d/etc/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Users/<username>/Google 繝峨Λ繧、繝 /.emacs.d/etc/CMake/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"C:/Users/<username>/AppData/Roaming/.emacs.d/etc/MinGW/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/<username>/Desktop/sample/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/<username>/AppData/Roaming/.emacs.d/etc/MinGW/msys/1.0/bin/make.exe" "cmTC_39024/fast"
/usr/bin/make -f CMakeFiles/cmTC_39024.dir/build.make CMakeFiles/cmTC_39024.dir/build
make[1]: Entering directory `/c/Users/<username>/Desktop/sample/CMakeFiles/CMakeTmp'
/bin/sh: /C/Users/<username>/Google 郢晏ウィホ帷ケァ 、郢昴 .emacs.d/etc/CMake/bin/cmake.exe: No such file or directory
make[1]: *** [CMakeFiles/cmTC_39024.dir/testCCompiler.c.obj] Error 127
make[1]: Leaving directory `/c/Users/<username>/Desktop/sample/CMakeFiles/CMakeTmp'
make: *** [cmTC_39024/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:10 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/<username>/Desktop/sample/CMakeFiles/CMakeOutput.log".
See also "C:/Users/<username>/Desktop/sample/CMakeFiles/CMakeError.log".
追記
試しに英語のみのディレクトリに移したところ、次のように、同じようなエラーが出ました。ディレクトリが日本語であることが原因ではないようです。初めにでている-- The C(XX) compiler identification is unknown
の部分も少し怪しい気がしますが、どうなんでしょう。
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: C:/Users/<username>/AppData/Roaming/.emacs.d/etc/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/Users/<username>/AppData/Roaming/.emacs.d/etc/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Users/<username>/Google Drive/.emacs.d/etc/CMake/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"C:/Users/<username>/AppData/Roaming/.emacs.d/etc/MinGW/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/<username>/Desktop/sample/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/<username>/AppData/Roaming/.emacs.d/etc/MinGW/msys/1.0/bin/make.exe" "cmTC_906e3/fast"
/usr/bin/make -f CMakeFiles/cmTC_906e3.dir/build.make CMakeFiles/cmTC_906e3.dir/build
make[1]: Entering directory `/c/Users/<username>/Desktop/sample/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_906e3.dir/testCCompiler.c.obj
/C/Users/<username>/AppData/Roaming/.emacs.d/etc/MinGW/bin/gcc.exe -o CMakeFiles/cmTC_906e3.dir/testCCompiler.c.obj -c /C/Users/<username>/Desktop/sample/CMakeFiles/CMakeTmp/testCCompiler.c
make[1]: *** [CMakeFiles/cmTC_906e3.dir/testCCompiler.c.obj] Error 1
make[1]: Leaving directory `/c/Users/<username>/Desktop/sample/CMakeFiles/CMakeTmp'
make: *** [cmTC_906e3/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:10 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/<username>/Desktop/sample/CMakeFiles/CMakeOutput.log".
See also "C:/Users/<username>/Desktop/sample/CMakeFiles/CMakeError.log".