Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gcc 构建OpenCV时CMake的问题_Gcc_Image Processing_Opencv_Cmake - Fatal编程技术网

Gcc 构建OpenCV时CMake的问题

Gcc 构建OpenCV时CMake的问题,gcc,image-processing,opencv,cmake,Gcc,Image Processing,Opencv,Cmake,我正试图在一个足够少的VPS上构建OpenCV的最新版本,但在CMake上遇到了麻烦。我不熟悉CMake,因此我发现很难解释日志输出,因此也很难继续调试问题 从命令行(未安装x11)和devel/OpenCV/-2.3.1/release I中发出以下命令 sudo cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. 其结果如下: -- Extracting svn version, please w

我正试图在一个足够少的VPS上构建OpenCV的最新版本,但在CMake上遇到了麻烦。我不熟悉CMake,因此我发现很难解释日志输出,因此也很难继续调试问题

从命令行(未安装x11)和devel/OpenCV/-2.3.1/release I中发出以下命令

sudo cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. 
其结果如下:

-- Extracting svn version, please wait...
-- SVNVERSION: exported
-- Detected version of GNU GCC: 44 (404)
-- Could NOT find ZLIB  (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Could NOT find ZLIB  (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Could NOT find PNG  (missing:  PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
-- Could NOT find TIFF  (missing:  TIFF_LIBRARY TIFF_INCLUDE_DIR)
-- Could NOT find JPEG  (missing:  JPEG_LIBRARY JPEG_INCLUDE_DIR)
--     Use NumPy headers from: /usr/lib/python2.6/site-packages/numpy-1.6.1-py2.6-linux-i686.egg/numpy/core/include
--     Found Sphinx 0.6.6: /usr/bin/sphinx-build
-- Parsing 'cvconfig.h.cmake'
--
-- General configuration for opencv 2.3.1 =====================================
--
--     Built as dynamic libs?:     YES
--     Compiler:                   /usr/bin/c++
--     C++ flags (Release):          -Wall -pthread -march=i686 -ffunction-sections  -O3 -DNDEBUG  -fomit-frame-pointer -msse -msse2 -mfpmath=387 -DNDEBUG\

--     C++ flags (Debug):            -Wall -pthread -march=i686 -ffunction-sections  -g  -O0 -DDEBUG -D_DEBUG -ggdb3
--     Linker flags (Release):
--     Linker flags (Debug):
--
--   GUI:
--     GTK+ 2.x:                   NO
--     GThread:                    NO
--
--   Media I/O:
--     ZLib:                       build
--     JPEG:                       build
--     PNG:                        build
--     TIFF:                       build
--     JPEG 2000:                  FALSE
--     OpenEXR:                    NO
--     OpenNI:                     NO
--     OpenNI PrimeSensor Modules: NO
--     XIMEA:                      NO
--
--   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
--     UniCap:                     NO
--     PvAPI:                      NO
--     V4L/V4L2:                   FALSE/FALSE
--     Xine:                       NO
--
--   Other third-party libraries:
--     Use IPP:                    NO
--     Use TBB:                    NO
--     Use ThreadingFramework:     NO
--     Use Cuda:                   NO
--     Use Eigen:                  NO
--
--   Interfaces:
--     Python:                     NO
--     Python interpreter:         /usr/bin/python2.6 -B (ver 2.6)
--     Python numpy:               YES
--     Java:                       NO
--
--   Documentation:
--     Sphinx:                     /usr/bin/sphinx-build (ver 0.6.6)
--     PdfLaTeX compiler:          NO
--     Build Documentation:        NO
--
--   Tests and samples:
--     Tests:                      YES
--     Examples:                   NO
--
--   Install path:                 /usr/local
--
--   cvconfig.h is in:             /home/ec2-user/OpenCV-2.3.1/release
-- -----------------------------------------------------------------
--
-- Configuring incomplete, errors occurred!
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
if(DEFINED CMAKE_BUILD_TYPE)
    set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
endif()
此外,当我运行该命令时,我似乎还收到以下错误消息 CMakeLists.txt处的CMake错误:44(set_属性): 给定无效的作用域缓存,设置\u属性。有效作用域是全局的, 目录、目标、源、测试

第42-45行如下:

-- Extracting svn version, please wait...
-- SVNVERSION: exported
-- Detected version of GNU GCC: 44 (404)
-- Could NOT find ZLIB  (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Could NOT find ZLIB  (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Could NOT find PNG  (missing:  PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
-- Could NOT find TIFF  (missing:  TIFF_LIBRARY TIFF_INCLUDE_DIR)
-- Could NOT find JPEG  (missing:  JPEG_LIBRARY JPEG_INCLUDE_DIR)
--     Use NumPy headers from: /usr/lib/python2.6/site-packages/numpy-1.6.1-py2.6-linux-i686.egg/numpy/core/include
--     Found Sphinx 0.6.6: /usr/bin/sphinx-build
-- Parsing 'cvconfig.h.cmake'
--
-- General configuration for opencv 2.3.1 =====================================
--
--     Built as dynamic libs?:     YES
--     Compiler:                   /usr/bin/c++
--     C++ flags (Release):          -Wall -pthread -march=i686 -ffunction-sections  -O3 -DNDEBUG  -fomit-frame-pointer -msse -msse2 -mfpmath=387 -DNDEBUG\

--     C++ flags (Debug):            -Wall -pthread -march=i686 -ffunction-sections  -g  -O0 -DDEBUG -D_DEBUG -ggdb3
--     Linker flags (Release):
--     Linker flags (Debug):
--
--   GUI:
--     GTK+ 2.x:                   NO
--     GThread:                    NO
--
--   Media I/O:
--     ZLib:                       build
--     JPEG:                       build
--     PNG:                        build
--     TIFF:                       build
--     JPEG 2000:                  FALSE
--     OpenEXR:                    NO
--     OpenNI:                     NO
--     OpenNI PrimeSensor Modules: NO
--     XIMEA:                      NO
--
--   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
--     UniCap:                     NO
--     PvAPI:                      NO
--     V4L/V4L2:                   FALSE/FALSE
--     Xine:                       NO
--
--   Other third-party libraries:
--     Use IPP:                    NO
--     Use TBB:                    NO
--     Use ThreadingFramework:     NO
--     Use Cuda:                   NO
--     Use Eigen:                  NO
--
--   Interfaces:
--     Python:                     NO
--     Python interpreter:         /usr/bin/python2.6 -B (ver 2.6)
--     Python numpy:               YES
--     Java:                       NO
--
--   Documentation:
--     Sphinx:                     /usr/bin/sphinx-build (ver 0.6.6)
--     PdfLaTeX compiler:          NO
--     Build Documentation:        NO
--
--   Tests and samples:
--     Tests:                      YES
--     Examples:                   NO
--
--   Install path:                 /usr/local
--
--   cvconfig.h is in:             /home/ec2-user/OpenCV-2.3.1/release
-- -----------------------------------------------------------------
--
-- Configuring incomplete, errors occurred!
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
if(DEFINED CMAKE_BUILD_TYPE)
    set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
endif()
但是我不知道这意味着什么?有人有什么建议吗


非常感谢检查您的CMake版本。在2.8.0中实现了对
set_属性(缓存…
的支持

如果升级CMake不是您的选择-我想您可以放心地评论第44行。它似乎用于为GUI中的下拉列表创建值


我在构建opencv时遇到了很多错误,这些错误都是由错误的opencv版本引起的。我使用cmake 3.0成功构建了opencv 3.0(尽管cmake 2.6不适合我)。然后,当我发现我不得不降级到opencv 2.4.9时,我不得不回到我的系统默认的cmake 2.6,因为cmake 3.0不起作用。在opencv中运行cmake时,首先要检查的是版本是否出错

啊哈,我似乎有2.6版的CMake。当我把那些冒犯的台词注释掉时,一切都很顺利!非常感谢