2015-10-17 160 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」存在問題。