Windows 10中的Caffe构建错误

时间:2017-07-26 04:40:45

标签: gcc cmake windows-10 caffe

我尝试按照说明here在Windows 10中构建Caffe。我已经安装了所有先决条件和依赖项。但我收到了以下错误。

-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-
3.9/Modules/CMakeTestCCompiler.cmake:51 (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:/Caffe/caffe/build/CMakeFiles/CMakeTmp

 Run Build Command:"C:/Ninja/ninja.exe" "cmTC_6595e"

 [1/2] Building C object CMakeFiles\cmTC_6595e.dir\testCCompiler.c.obj

 FAILED: CMakeFiles/cmTC_6595e.dir/testCCompiler.c.obj

 C:\MinGW\bin\gcc.exe -o CMakeFiles\cmTC_6595e.dir\testCCompiler.c.obj -c
 testCCompiler.c

 ninja: build stopped: subcommand failed.

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


-- Configuring incomplete, errors occurred!
See also "C:/Caffe/caffe/build/CMakeFiles/CMakeOutput.log".
See also "C:/Caffe/caffe/build/CMakeFiles/CMakeError.log".
ERROR: Configure failed

Caffe Build Error

我搜索了一个解决方案并尝试了不同的东西,但没有什么能解决问题。对此方面的任何帮助都非常感谢。

提前致谢!

1 个答案:

答案 0 :(得分:1)

我终于明白了。这是我的计算机中的C编译器的一个问题 - gcc。我根据this solution

重新安装了编译器并在CMakeList.txt文件中添加了两行代码
set(CMAKE_C_COMPILER "C:/MinGW/bin/gcc.exe")
set(CMAKE_CXX_COMPILER "C:/MinGW/bin/g++.exe")
相关问题