我知道有一個類似的問題已經問這裏cmake reports gcc is broken. Where do I start? 然而,沒有真正的答案在那篇文章,因爲我也堅持,我認爲我會創建一個新的。 所以基本上我的環境是windows,我正在使用cygwin。 我正在嘗試安裝VTK。我已經使用Windows Cmake生成了所有內容。 現在,當我啓動我做得到以下輸出:C編譯器破解與cmake
`make
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Lonni/VTK/BuildCyg
[ 6%] Creating directories for 'vtk-compile-tools'
[ 12%] No download step for 'vtk-compile-tools'
[ 18%] No patch step for 'vtk-compile-tools'
[ 25%] No update step for 'vtk-compile-tools'
[ 31%] Performing configure step for 'vtk-compile-tools'
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: C:/cygwin64/bin/cc
-- Check for working C compiler: C:/cygwin64/bin/cc -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "C:/cygwin64/bin/cc" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: C:/Users/Lonni/VTK/BuildCyg/CMakeExternals/Build/vtk-compile-tools/CMakeFiles/CMakeTmp
Run Build Command:"C:/Strawberry/c/bin/gmake.exe"
"cmTryCompileExec4220576950/fast"
gmake.exe[3]: Entering directory
'C:/Users/Lonni/VTK/BuildCyg/CMakeExternals/Build/vtk-compile-tools/CMakeFiles/CMakeTmp'
C:/Strawberry/c/bin/gmake.exe -f
CMakeFiles/cmTryCompileExec4220576950.dir/build.make
CMakeFiles/cmTryCompileExec4220576950.dir/build
gmake.exe[4]: Entering directory
'C:/Users/Lonni/VTK/BuildCyg/CMakeExternals/Build/vtk-compile-tools/CMakeFiles/CMakeTmp'
"C:/Program Files (x86)/CMake/bin/cmake.exe" -E cmake_progress_report
C:/Users/Lonni/VTK/BuildCyg/CMakeExternals/Build/vtk-compile-tools/CMakeFiles/CMakeTmp/CMakeFiles
1
Building C object
CMakeFiles/cmTryCompileExec4220576950.dir/testCCompiler.c.obj
C:/cygwin64/bin/cc -o
CMakeFiles/cmTryCompileExec4220576950.dir/testCCompiler.c.obj -c
C:/Users/Lonni/VTK/BuildCyg/CMakeExternals/Build/vtk-compile-tools/CMakeFiles/CMakeTmp/testCCompiler.c
process_begin: CreateProcess(C:\cygwin64\bin\cc, C:/cygwin64/bin/cc -o
CMakeFiles/cmTryCompileExec4220576950.dir/testCCompiler.c.obj -c
C:/Users/Lonni/VTK/BuildCyg/CMakeExternals/Build/vtk-compile-tools/CMakeFiles/CMakeTmp/testCCompiler.c,
...) failed.
make (e=5): Acc▒s refus▒.
gmake.exe[4]: ***
[CMakeFiles/cmTryCompileExec4220576950.dir/testCCompiler.c.obj] Error 5
CMakeFiles/cmTryCompileExec4220576950.dir/build.make:57: recipe for target
'CMakeFiles/cmTryCompileExec4220576950.dir/testCCompiler.c.obj' failed
gmake.exe[4]: Leaving directory
'C:/Users/Lonni/VTK/BuildCyg/CMakeExternals/Build/vtk-compile-tools/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec4220576950/fast' failed
gmake.exe[3]: *** [cmTryCompileExec4220576950/fast] Error 2
gmake.exe[3]: Leaving directory
'C:/Users/Lonni/VTK/BuildCyg/CMakeExternals/Build/vtk-compile-tools/CMakeFiles/CMakeTmp'
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:28 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Lonni/VTK/BuildCyg/CMakeExternals/Build/vtk-compile-tools/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Lonni/VTK/BuildCyg/CMakeExternals/Build/vtk-compile-tools/CMakeFiles/CMakeError.log".
CMakeFiles/vtk-compile-tools.dir/build.make:102 : la recette pour la cible « CMakeExternals/Prefix/vtk-compile-tools/src/vtk-compile-tools-stamp/vtk-compile-tools-configure » a échouée
make[2]: *** [CMakeExternals/Prefix/vtk-compile-tools/src/vtk-compile-tools-stamp/vtk-compile-tools-configure] Erreur 1
CMakeFiles/Makefile2:95 : la recette pour la cible « CMakeFiles/vtk-compile-tools.dir/all » a échouée
make[1]: *** [CMakeFiles/vtk-compile-tools.dir/all] Erreur 2
Makefile:75 : la recette pour la cible « all » a échouée
make: *** [all] Erreur 2`
所以我想這可能與這樣的事實,我的配置是有窗戶的cmake完成的,所以我試圖用cygwin cmake的,但是當我做我得到以下錯誤:
cmake .
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
CMake Error at C:/Users/Lonni/VTK/VTK-6.2.0/CMakeLists.txt:28 (project):
The CMAKE_C_COMPILER:
C:/Strawberry/c/bin/gcc.exe
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 C:/Users/Lonni/VTK/VTK-6.2.0/CMakeLists.txt:28 (project):
The CMAKE_CXX_COMPILER:
C:/Strawberry/c/bin/g++.exe
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 "/cygdrive/c/Users/Lonni/VTK/BuildCyg2/CMakeFiles/CMakeOutput.log".
See also "/cygdrive/c/Users/Lonni/VTK/BuildCyg2/CMakeFiles/CMakeError.log".
現在我知道我是一個完整的新手到這一切,但我有點困在這裏,到目前爲止,我已經在網上搜索所有不利於在所有。
在此先感謝您的幫助。
編輯:如果我配置使用/cygdrive/c/Strawberry/c/bin/gcc.exe而不是/cygdrive/c/Strawberry/c/bin/gcc.exe我確實遇到同樣的錯誤,只有路徑更新
cmake .
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- Check for working C compiler: /cygdrive/c/Strawberry/c/bin/gcc.exe
-- Check for working C compiler: /cygdrive/c/Strawberry/c/bin/gcc.exe -- broken
CMake Error at /usr/share/cmake-3.1.2/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/cygdrive/c/Strawberry/c/bin/gcc.exe" is not able to
compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/Lonni/VTK/BuildCyg2/CMakeFiles/CMakeTmp
Run Build Command:"C:/Strawberry/c/bin/gmake.exe"
"cmTryCompileExec1614361486/fast"
C:/Strawberry/c/bin/gmake -f
CMakeFiles/cmTryCompileExec1614361486.dir/build.make
CMakeFiles/cmTryCompileExec1614361486.dir/build
gmake[1]: Entering directory
'C:/Users/Lonni/VTK/BuildCyg2/CMakeFiles/CMakeTmp'
/usr/bin/cmake.exe -E cmake_progress_report
/cygdrive/c/Users/Lonni/VTK/BuildCyg2/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object
CMakeFiles/cmTryCompileExec1614361486.dir/testCCompiler.c.o
/cygdrive/c/Strawberry/c/bin/gcc.exe -o
CMakeFiles/cmTryCompileExec1614361486.dir/testCCompiler.c.o -c
/cygdrive/c/Users/Lonni/VTK/BuildCyg2/CMakeFiles/CMakeTmp/testCCompiler.c
CMakeFiles/cmTryCompileExec1614361486.dir/build.make:57: recipe for target
'CMakeFiles/cmTryCompileExec1614361486.dir/testCCompiler.c.o' failed
gmake[1]: Leaving directory
'C:/Users/Lonni/VTK/BuildCyg2/CMakeFiles/CMakeTmp'
gcc.exe: error:
/cygdrive/c/Users/Lonni/VTK/BuildCyg2/CMakeFiles/CMakeTmp/testCCompiler.c:
No such file or directory
gcc.exe: fatal error: no input files
compilation terminated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec1614361486.dir/testCCompiler.c.o]
Error 1
Makefile:118: recipe for target 'cmTryCompileExec1614361486/fast' failed
gmake: *** [cmTryCompileExec1614361486/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
C:/Users/Lonni/VTK/VTK-6.2.0/CMakeLists.txt:28 (project)
CMake Error at C:/Users/Lonni/VTK/VTK-6.2.0/CMakeLists.txt:28 (project):
The CMAKE_CXX_COMPILER:
C:/Strawberry/c/bin/g++.exe
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!
我猜我需要做的路徑的東西,但我不知道這是否是真正的解決方案。如果需要的話
echo $PATH
/usr/bin/:/usr/local/bin:/usr/bin:/usr/bin:/cygdrive/c/Program Files/MicrosoftMPI/Bin:/cygdrive/c/Perl64/site/bin:/cygdrive/c/Perl64/bin:/cygdrive/c/ProgramData/Oracle/Java/javapath:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/Java/jdk1.8.0_45/bin:/cygdrive/c/Program Files (x86)/Windows Kits/8.1/Windows Performance Toolkit:/cygdrive/c/Program Files/Microsoft SQL Server/110/Tools/Binn:/cygdrive/c/Program Files (x86)/CMake/bin:/cygdrive/c/Program Files/doxygen/bin:/cygdrive/c/Strawberry/c/bin:/cygdrive/c/Strawberry/perl/site/bin:/cygdrive/c/Strawberry/perl/bin:/cygdrive/c/Users/Lonni/Dev Utilities/gluegen/gluegen-2.3-b858-20150410-windows-amd64/gluegen-2.3-b858-20150410-windows-amd64/jar/gluegen-rt.jar:/cygdrive/c/Users/Lonni/Dev Utilities/jogl-2.3-b1392-20150410-windows-amd64/jogl-2.3-b1392-20150410-windows-amd64/jar/atomic/jogl.jar:/cygdrive/c/Program Files (x86)/Git/cmd:/cygdrive/c/Tcl/bin:/usr/bin:/cygdrive/c/Program Files/Microsoft MPI/Bin:/cygdrive/c/Perl64/site/bin:/cygdrive/c/Perl64/bin:/cygdrive/c/ProgramData/Oracle/Java/javapath:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/Java/jdk1.8.0_45/bin:/cygdrive/c/Program Files (x86)/Windows Kits/8.1/Windows Performance Toolkit:/cygdrive/c/Program Files/Microsoft SQL Server/110/Tools/Binn:/cygdrive/c/Program Files (x86)/CMake/bin:/cygdrive/c/Program Files/doxygen/bin:/cygdrive/c/Strawberry/c/bin:/cygdrive/c/Strawberry/perl/site/bin:/cygdrive/c/Strawberry/perl/bin:/cygdrive/c/Users/Lonni/Dev Utilities/gluegen/gluegen-2.3-b858-20150410-windows-amd64/gluegen-2.3-b858-20150410-windows-amd64/jar/gluegen-rt.jar:/cygdrive/c/Users/Lonni/Dev Utilities/jogl-2.3-b1392-20150410-windows-amd64/jogl-2.3-b1392-20150410-windows-amd64/jar/atomic/jogl.jar:/cygdrive/c/Program Files (x86)/Git/cmd:/usr/lib/lapack
是否存在'C:/ cygwin64/bin/cc'? 「C:/ Strawberry/c/bin/gcc.exe」是否存在? –
他們都是。 – LBes
如果您將第二個示例配置爲'/ cygdrive/c/Strawberry/c/bin/gcc.exe'而不是'C:/ Strawberry/c/bin/gcc.exe',它可能會起作用。前者顯然有一些權限問題,但不清楚什麼。如果你手動運行這個命令,它會告訴你更多關於怎麼回事? –