Я пытаюсь скомпилировать Google Test с Mingw-w64 на компьютере с Windows 10, но всегда получаю сообщение об ошибке:
C:\git\tdd\googletest>cmake CMakeLists.txt -G "MinGW Makefiles"
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Вот что я делаю:
- Откройте терминал Windows CMD и измените папку t, в которую я скачал google test
- Добавьте CMake, make и g ++ к пути
set PATH="C:\Program Files\CMake\bin";"C:\msys\bin";"C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin";%PATH%
- Запустите CMake с
cmake CMakeLists.txt -G "MinGW Makefiles"
Это версии инструментов:
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i686-pc-msys
- cmake версия 3.15.3
- g ++ (i686-posix-dwarf-rev0, встроенныйПроект MinGW-W64) 8.1.0
Make поставляется из пакета MSYS от Mingw-64w . Я клонировал Google Test из здесь
Любая помощь очень ценится!
EDIT 1
Ни одно из решений в CMake / MinGW неизвестноcompilers, gcc.exe не работает работа.
EDIT 2
Я также пытался использовать переменные окружения, чтобы указать CMake, какие инструменты использовать.
- Добавилпапки инструментов в ПУТИ:
set PATH="C:\Program Files\CMake\bin";"C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin";%PATH%
Вызов CMake с
cmake -DCMAKE_C_COMPILER="C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gcc" -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/g++" -DCMAKE_MAKE_PROGRAM="C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/mingw32-make.exe" CMakeLists.txt -G "MinGW Makefiles"
Я получаю эту ошибку:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:10 (project):
The CMAKE_C_COMPILER:
C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gcc
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:10 (project):
The CMAKE_CXX_COMPILER:
C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/g++
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/git/tdd/googletest/CMakeFiles/CMakeOutput.log".
See also "C:/git/tdd/googletest/CMakeFiles/CMakeError.log".
Поскольку g ++ и gcc находятся в PATH, я также пыталсявызвать CMake так:
cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DCMAKE_MAKE_PROGRAM="mingw32-make.exe" CMakeLists.txt -G "MinGW Makefiles"
, что выдает ту же ошибку, что и предыдущая попытка:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:10 (project):
The CMAKE_C_COMPILER:
gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:10 (project):
The CMAKE_CXX_COMPILER:
g++
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/git/tdd/googletest/CMakeFiles/CMakeOutput.log".
See also "C:/git/tdd/googletest/CMakeFiles/CMakeError.log".
Однако я CAN Позвоните g++
:
C:\git\tdd\googletest>g++
g++: fatal error: no input files
compilation terminated.
Еще раз спасибо!