0

我来自机甲背景,所以我可能会遗漏一些完全微不足道的东西。使用 Unix makefile在我的 mac (OS X 10.7 Lion) 上安装了 openCV2.4.1 。每个都与makeand正确sudo make install匹配,所有 .dylib 文件都在lib文件夹中,但我在任何地方都找不到头文件(“cv.h”等)。include文件夹只有 cmake_install.cmake、Makefile 文件和CMakeFiles文件夹。

我之前通过自制软件安装了 openCV 2.3.1,并且标头都在包含中,所以我必须在Library Search Paths中将该路径添加到 XCode 。现在我不确定如何在没有它的情况下使用库......?

编辑

我正在使用 CMake 2.8.4 GUI。它在那里指定“源代码在哪里”和“在哪里构建二进制文件”。我正在查找为“构建二进制文件的位置”指定的文件夹。既然你提到了它,我检查了源代码文件夹并找到了标题,但是那里当然没有 .dylib 文件......

无论如何,我再次运行 CMake(到另一个二进制文件夹,但应该是相同的输出)以获取输出,这里是:

The CXX compiler identification is Clang
The C compiler identification is GNU
Check for working CXX compiler: /usr/bin/c++
Check for working CXX compiler: /usr/bin/c++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Checking whether C compiler has -isysroot
Checking whether C compiler has -isysroot - yes
Checking whether C compiler supports OSX deployment target flag
Checking whether C compiler supports OSX deployment target flag - yes
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
Extracting svn version, please wait...
SVNVERSION: exported
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
Looking for fseeko
Looking for fseeko - found
Looking for unistd.h
Looking for unistd.h - found
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
checking for module 'libdc1394-2'
  package 'libdc1394-2' not found
checking for module 'libdc1394'
  package 'libdc1394' 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
CUDA_TOOLKIT_ROOT_DIR not found or specified
Could NOT find CUDA (missing:  CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "4.1")
Found PythonInterp: /usr/bin/python2.7 (Required is at least version "2.0")
Found PythonLibs: /usr/lib/libpython2.7.dylib (Required is at least version "2.7.1")

General configuration for OpenCV 2.4.1 =====================================

  Platform:
    Host:                        Darwin 11.4.0 i386
    CMake:                       2.8.4
    CMake generator:             Unix Makefiles
    CMake build tool:            /usr/bin/make
    Configuration:               Release

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                /usr/bin/c++
    C++ flags (Release):         -O3 -DNDEBUG  
    C++ flags (Debug):           -g 
    C Compiler:                  /usr/bin/gcc
    C flags (Release):           -O3 -DNDEBUG 
    C flags (Debug):             -g 
    Linker flags (Release):
    Linker flags (Debug):

  OpenCV modules:
    To be built:                 calib3d contrib core features2d flann gpu highgui imgproc legacy ml nonfree objdetect photo python stitching ts video videostab
    Disabled:                    -
    Disabled by dependency:      -
    Unavailable:                 androidcamera java

  GUI: 
    QT 4.x:                      NO
    Cocoa:                       YES
    OpenGL support:              NO

  Media I/O: 
    ZLib:                        build (ver 1.2.6)
    JPEG:                        build (ver 62)
    PNG:                         build (ver 1.5.9)
    TIFF:                        build (ver 42)
    JPEG 2000:                   build (ver 1.900.1)
    OpenEXR:                     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
    OpenNI:                      NO
    OpenNI PrimeSensor Modules:  NO
    PvAPI:                       NO
    QuickTime:                   NO
    QTKit:                       YES

  Other third-party libraries:
    Use IPP:                     NO
    Use TBB:                     NO
    Use Cuda:                    NO
    Use Eigen:                   NO

  Python:
    Interpreter:                 /usr/bin/python2.7 (ver 2.7.1)
    Libraries:                   /usr/lib/libpython2.7.dylib
    numpy:                       /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include (ver 1.5.1)
    packages path:               lib/python2.7/site-packages

  Documentation:
    Build Documentation:         NO
    Sphinx:                      NO
    PdfLaTeX compiler:           NO

  Tests and samples:
    Tests:                       YES
    Performance tests:           YES
    Examples:                    NO

  Install path:                  /usr/local

  cvconfig.h is in:              /Users/steveheim/Documents/opencvtest
-----------------------------------------------------------------

Configuring done
4

1 回答 1

0

从您的 CMake 输出中:

安装路径:/usr/local

这意味着在make install完成 OpenCV 标头后将被复制到/usr/local/include/

要更改此位置,您可以将CMAKE_INSTALL_PREFIXCMake 变量的值设置/修改为所需位置。

于 2012-06-26T12:05:31.737 回答