2015-10-17 175 views
0

我想在运行Raspbian Jessie的Raspberry Pi 2上搭建OpenCV 3.0.0。安装完所有的依赖关系之后,我试着用以下参数运行cmake:cmake -D CMAKE_C_COMPILER=/usr/bin/gcc -D CMAKE_CXX_COMPILER=/usr/bin/c++ -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..cmake不能在Raspberry Pi 2上工作

但是后来我得到了以下错误。

CMake Error: Error in cmake code at 
/usr/share/cmake-3.0/Modules/CMakeDetermineCXXCompiler.cmake:112: 
Parse error. Function missing ending ")". End of file reached. 
CMake Error: Could not find cmake module file: /usr/share/cmake-3.0/Modules/CMakeDetermineCXXCompiler.cmake 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_CXX_COMPILER_ENV_VAR 
CMake Error: Could not find cmake module file: /home/pi/Downloads/opencv-3.0.0/release/CMakeFiles/3.0.2/CMakeCXXCompiler.cmake 
CMake Error: Error in cmake code at 
/usr/share/cmake-3.0/Modules/CMakeDetermineCCompiler.cmake:119: 
Parse error. Expected a command name, got unquoted argument with text "". 
CMake Error: Could not find cmake module file: /usr/share/cmake-3.0/Modules/CMakeDetermineCCompiler.cmake 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_C_COMPILER_ENV_VAR 
CMake Error: Could not find cmake module file: /home/pi/Downloads/opencv-3.0.0/release/CMakeFiles/3.0.2/CMakeCCompiler.cmake 
CMake Error: Error in cmake code at 
/usr/share/cmake-3.0/Modules/CMakeCXXInformation.cmake:221: 
Parse error. Function missing ending ")". End of file reached. 
CMake Error: Could not process cmake module file: /usr/share/cmake-3.0/Modules/CMakeCXXInformation.cmake 
-- Check for working CXX compiler: /usr/bin/c++ 
CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCXXCompiler.cmake:40 (try_compile): 
    Unknown extension ".cxx" for file 

    /home/pi/Downloads/opencv-3.0.0/release/CMakeFiles/CMakeTmp/testCXXCompiler.cxx 

    try_compile() works only for enabled languages. Currently these are: 

    C CXX 

    See project() command to enable other languages. 
Call Stack (most recent call first): 
    CMakeLists.txt:88 (project) 


-- Check for working CXX compiler: /usr/bin/c++ -- broken 
CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCXXCompiler.cmake:54 (message): 
    The C++ compiler "/usr/bin/c++" is not able to compile a simple test 
    program. 

    It fails with the following output: 





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


CMake Error: Error in cmake code at 
/usr/share/cmake-3.0/Modules/CMakeCInformation.cmake:113: 
Parse error. Function missing ending ")". End of file reached. 
CMake Error: Could not process cmake module file: /usr/share/cmake-3.0/Modules/CMakeCInformation.cmake 
-- Configuring incomplete, errors occurred! 
See also "/home/pi/Downloads/opencv-3.0.0/release/CMakeFiles/CMakeOutput.log". 
See also "/home/pi/Downloads/opencv-3.0.0/release/CMakeFiles/CMakeError.log". 

有什么建议吗?

+0

你确定'/ usr/bin/C++'符号链接吗?直接尝试'/ usr/bin/g ++' – Berriel

+0

是的,我用'/ usr/bin/g ++'试过了,得到了同样的错误。 '/ usr/bin/g ++'指向'g ++ - 4.9'。 – android

+0

尝试使用g ++编译任何C++程序。如果你成功了,我不知道它可能是什么 – Berriel

回答

0

这实际上并不是一个解决方案,但我再次重新安装了我的Raspberry Pi,但是这次使用了较老的Raspbian版本“Wheezy”。在Wheezy上,一切正常。所以我猜想在OpenCV和/或cmake中Raspbian“Jessie”存在问题。