c++ - cmake 不适用于 Raspberry Pi 2

标签 c++ linux opencv makefile g++

我正在尝试在运行 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 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".

有什么建议吗?

最佳答案

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

关于c++ - cmake 不适用于 Raspberry Pi 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33191353/

相关文章:

c++ - 什么是 C++ 中的 static_case 运算符?

Python条件基础打印颜色字符串

c++ - 消除光流算法中的噪声?

c++ - CodeChef 显示 gets() 未在任何范围内声明。虽然在 Codeblocks 上可以正常工作

linux - 如何使用cp从不同目录复制多个文件?

java - 无法在opencv java中乘以矩阵

opencv:纠正这些扭曲的图像

opencv - 长度比的计算机视觉

c++ - push_back 如何在 STL vector 中实现?

linux - crt* 文件在链接中的作用是什么?