- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在尝试使用 CMake 构建 OpenCV,但是当我构建它时,有些东西出错了,我不知道如何修复它。
所以问题基本上是:我该如何修复它?
user@BEL-PC:~/opencv/build$ cmake -DBUILD_SHARED_LIBS=OFF ..
-- The CXX compiler identification is unknown
-- The C compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Performing Test HAVE_CXX_FSIGNED_CHAR
CMake Error at /usr/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:37 (GET_FILENAME_COMPONENT):
get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
CMakeLists.txt:2 (PROJECT)
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Performing Test HAVE_CXX_FSIGNED_CHAR - Failed
-- Performing Test HAVE_C_FSIGNED_CHAR
-- Performing Test HAVE_C_FSIGNED_CHAR - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - failed
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Looking for assert.h
-- Looking for assert.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for io.h
-- Looking for io.h - not found
-- Looking for jbg_newlen
-- Looking for jbg_newlen - not found
-- Looking for mmap
-- Looking for mmap - found
-- Looking for search.h
-- Looking for search.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Found JPEG: libjpeg
-- Could NOT find Jasper (missing: JASPER_LIBRARY JASPER_INCLUDE_DIR)
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Found ZLIB: zlib (found version "1.2.7")
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Looking for semaphore.h
-- Looking for semaphore.h - found
-- checking for module 'gtk+-2.0'
-- package 'gtk+-2.0' not found
-- checking for module 'gthread-2.0'
-- package 'gthread-2.0' not found
-- checking for module 'gstreamer-base-0.10'
-- package 'gstreamer-base-0.10' not found
-- checking for module 'libdc1394-2'
-- package 'libdc1394-2' not found
-- checking for module 'libdc1394'
-- package 'libdc1394' not found
-- checking for module 'libv4l1'
-- package 'libv4l1' not found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- checking for module 'libavcodec'
-- package 'libavcodec' not found
-- checking for module 'libavformat'
-- package 'libavformat' not found
-- checking for module 'libavutil'
-- package 'libavutil' not found
-- checking for module 'libswscale'
-- package 'libswscale' not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - not found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
CMake Error at /usr/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:37 (GET_FILENAME_COMPONENT):
get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
CMakeLists.txt:2 (PROJECT)
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Found PythonInterp: /usr/bin/python (found suitable version "2.7.3", required is "2.0")
-- Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (Required is at least version "2.7.3")
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named numpy.distutils
-- Found apache ant 1.8.2: /usr/bin/ant
-- Found JNI: /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/libjawt.so
-- Could NOT find OPENCL (missing: OPENCL_LIBRARY OPENCL_INCLUDE_DIR)
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
--
-- General configuration for OpenCV 2.4.6.1 =====================================
-- Version control: 2.4.6.1-176-g1c55096
--
-- Platform:
-- Host: Linux 3.5.0-37-generic x86_64
-- CMake: 2.8.7
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: Release
--
-- C/C++:
-- Built as dynamic libs?: NO
-- C++ Compiler: CMAKE_CXX_COMPILER-NOTFOUND
-- C++ flags (Release):
-- C++ flags (Debug):
-- C Compiler: /usr/bin/gcc
-- C flags (Release): -fsigned-char -O3 -DNDEBUG
-- C flags (Debug): -fsigned-char -g
-- Linker flags (Release):
-- Linker flags (Debug):
-- Precompiled headers: NO
--
-- OpenCV modules:
-- To be built: core imgproc flann highgui features2d calib3d ml video objdetect contrib photo legacy gpu nonfree java stitching superres ts videostab
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: androidcamera ocl python
--
-- GUI:
-- QT: NO
-- GTK+ 2.x: NO
-- GThread : NO
-- GtkGlExt: NO
-- OpenGL support: NO
--
-- Media I/O:
-- ZLib: zlib (ver 1.2.7)
-- JPEG: libjpeg (ver 62)
-- PNG: build (ver 1.5.12)
-- TIFF: build (ver 42 - 4.0.2)
-- JPEG 2000: build (ver 1.900.1)
-- OpenEXR: build (ver 1.7.1)
--
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: NO
-- FFMPEG: NO
-- codec: NO
-- format: NO
-- util: NO
-- swscale: NO
-- gentoo-style: NO
-- GStreamer: NO
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- PvAPI: NO
-- GigEVisionSDK: NO
-- UniCap: NO
-- UniCap ucil: NO
-- V4L/V4L2: NO/YES
-- XIMEA: NO
-- Xine: NO
--
-- Other third-party libraries:
-- Use IPP: NO
-- Use Eigen: NO
-- Use TBB: NO
-- Use OpenMP: NO
-- Use GCD NO
-- Use Concurrency NO
-- Use C=: NO
-- Use Cuda: NO
-- Use OpenCL: NO
--
-- Python:
-- Interpreter: /usr/bin/python (ver 2.7.3)
--
-- Java:
-- ant: /usr/bin/ant (ver 1.8.2)
-- JNI: /usr/lib/jvm/jdk1.7.0_21/include /usr/lib/jvm/jdk1.7.0_21/include/linux /usr/lib/jvm/jdk1.7.0_21/include
-- Java tests: YES
--
-- Documentation:
-- Build Documentation: NO
-- Sphinx: NO
-- PdfLaTeX compiler: NO
--
-- Tests and samples:
-- Tests: YES
-- Performance tests: YES
-- C/C++ Examples: NO
--
-- Install path: /usr/local
--
-- cvconfig.h is in: /home/user/opencv/build
-- -----------------------------------------------------------------
--
-- Configuring incomplete, errors occurred!
最佳答案
感谢 hetepeperfan 我能够解决我的问题。结果证明我只是缺少 C++ 编译器。
在运行 sudo apt-get install build-essential
并清理我的构建文件夹并重新运行 cmake 后,问题得到解决。
关于linux - 构建 OpenCV (Ubuntu) 时 CMake 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18126732/
运行 pip install cmake 时出现上述错误在 alpine linux (WSL) 上。 完整错误: /home/user# pip install cmake Collecting c
我的项目依赖 mariadb-connector-c我正在尝试使用 cmake 自动化下载、构建和链接过程。 我目前将项目下载到一个目录中,然后尝试执行生成忍者文件并运行它们,但我根本无法运行 cma
我正在尝试像这样在 cmake 中执行 execute_process execute_process(COMMAND ${CMAKE_COMMAND} -P myScript.cmake 这仅在文件
我想知道如果我没有给它任何变量告诉它在哪里找到它,cmake 如何找到我的 llvm cmake 配置。 我是 LLVM 新手。我正在构建一个 Hello World LLVM pass。我在 Ubu
我正在开发一个使用 CMake 的项目。顶CMakeLists.txt文件包含以下行: cmake_minimum_required(VERSION 3.7.2) # Kittens will die
我正在使用 Meego 1.2 工具链使用 cmake 运行构建(长话短说)。这个特定的工具链需要使用 --sysroot 选项来查找它需要的任何库。 set (CMAKE_CXX_FLAGS "-f
我们有一些源代码处理工具,可以从多个“片段”生成原始汇编文件等内容。 当使用 make 中的这些工具时,我们可以通过让源处理工具发出“依赖文件”来确保最新的构建,就像 gcc 一样-MD 标志。 例如
如何在 MSYS2 中安装和配置“cmake”?我尝试安装以下 MSYS 包 我在运行任何 cmake 命令时都收到以下错误 '''CMakeLists.txt:5 (cmake_minimum_re
有没有办法在 CMake 中得到一个变量列表?具体来说,我想要做的是调用一个现有函数,该函数接受多个变量并检查它们的计算结果是否为 true。 在某些情况下,其中一些变量将是空列表(计算结果为 fal
我有两组测试(功能测试和单元测试),我希望能够指定通过 cmake 运行哪一组。 一组测试是我想通过“make test”运行的单元测试。 另一组测试是我想通过“制作功能测试”来运行的功能测试。 目前
我的目标是查看有关调用 g++ 的详细信息由 cmake 直接调用从命令行。我不关心 make 的输出就这个问题而言。 根据official FAQ和 the accepted answer on a
我有一个生成库的CMake项目。我已经编写了一个CMake脚本FindXXX.cmake来帮助我的图书馆的用户。这样,他们可以使用find_package(XXX)并获取所需的变量。到现在为止还挺好。
当我看到带有命名空间的 CMake 库时,它们总是在表单中Parent::Component . 如果我有一个足够大的库,那么该库的子部分可能包含组件。我想知道是否可以/适合做 ParentProje
CMake 变量和属性似乎完成了非常相似的事情,我一直无法理解它们之间的区别。 它们每个都有自己的文档部分,但两者都会影响构建系统,两者都是“预先存在的”,并且两者都可以基于其他 CMake 命令动态
我有一个包含多个子目录的 CMake 项目,例如: dir1 subdir11 subdir12 dir2 subdir21 subdir22 根 CMakeLists
如果您想将静态库链接到共享库或可执行文件,同时保持所有符号可见(例如,您可以稍后打开它以找到它们),在 Linux/BSD 上执行此操作的一种非可移植方式是使用标志-Wl,--whole-archiv
CMake 自动创建一个 FooTarget.cmake文件例如添加 install(EXPORT FooTargets FILE FooTargets.cmake NAMESPACE Foo
在CMake中,ELSE和ENDIF控制流函数将表达式作为参数。根据文档,这些是optional。那么这些目的是什么?仅仅是为了维护目的而使原始IF表达式更清晰,还是提供某些功能? 最佳答案 正如您所
我是 cmake 的新手,我发现它非常令人沮丧。我试图在构建运行时评估的文件路径中使用通配符,而不是在生成构建时。 我创建了一个构建,它使用 SWIG 为某些 C++ 代码生成 Java 包装器。我可
我可能在谷歌上搜索错误,但我无法找到 .cmake 文件的用途。 我刚刚偶然发现了一个我必须使用的项目的 CMake 工具,我很难理解它是如何工作的。我明白在包含 CMakeLists.txt 的目录
我是一名优秀的程序员,十分优秀!