【问题标题】:'opencv2/opencv.hpp' file not found in my private pod在我的私人 pod 中找不到“opencv2/opencv.hpp”文件
【发布时间】:2017-08-15 15:35:11
【问题描述】:

我正在制作一个包含 opencv 和其他一些算法 cpp 文件的私有 pod。但是现在我遇到了一个问题,据说找不到“opencv2/opencv.hpp”文件。 我的 podspec 文件是这样的:

    #
    # Be sure to run `pod lib lint podOpenCV.podspec' to ensure this is a
    # valid spec before submitting.
    #
    # Any lines starting with a # are optional, but their use is encouraged
    # To learn more about a Podspec see                 http://guides.cocoapods.org/syntax/podspec.html
    #

    Pod::Spec.new do |s|
      s.name             = 'podOpenCV'
      s.version          = '0.1.0'
      s.summary          = 'A short description of podOpenCV.'

    # This description is used to generate tags and improve search results.
    #   * Think: What does it do? Why did you write it? What is the focus?
    #   * Try to keep it short, snappy and to the point.
    #   * Write the description between the DESC delimiters below.
    #   * Finally, don't worry about the indent, CocoaPods strips it!

      s.description      = <<-DESC
     TODO: Add long description of the pod here.
                   DESC

      s.homepage         = 'https://github.com/hudundun90@gmail.com/podOpenCV'
      # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
      s.license          = { :type => 'MIT', :file => 'LICENSE' }
      s.author           = { 'hudundun90@gmail.com' => 'hudun1@qq.com' }
      s.source           = { :git => 'https://github.com/hudundun90@gmail.com/podOpenCV.git', :tag => s.version.to_s }
      # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

      s.ios.deployment_target = '8.0'
      s.ios.vendored_libraries = 'podOpenCV/libs/*.a'
      s.ios.vendored_frameworks = 'podOpenCV/libs/opencv2.framework'

    s.source_files = 'podOpenCV/Classes/**/*{.h,.m,.cpp,.mm}'

      # s.resource_bundles = {
      #   'podOpenCV' => ['podOpenCV/Assets/*.png']
      # }

      # s.public_header_files = 'Pod/Classes/**/*.h'
      # s.frameworks = 'UIKit', 'MapKit'
      # s.dependency 'AFNetworking', '~> 2.3'

    s.frameworks = 'Accelerate', 'AssetsLibrary', 'AVFoundation', 'CoreGraphics', 'CoreImage', 'CoreMedia', 'CoreVideo', 'Foundation', 'QuartzCore', 'UIKit', 'OpenGLES'

    s.prefix_header_file = 'podOpenCV/Classes/podOpenCV.pch'

    s.libraries = 'sqlite3', 'z', 'c++', 'stdc++'

    s.xcconfig = {
    'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11',
    'CLANG_CXX_LIBRARY' => 'libc++'
    }

    end

这是我的源地图。

任何帮助都会很棒。

【问题讨论】:

  • 创建一个podfile并添加pod 'OpenCV',然后安装pod
  • 你的框架搜索路径是什么?
  • 我以前使用过 pod 'OpenCV'。现在我想用 opencv 制作我的私人 pod。
  • 您找到解决方案了吗?

标签: ios objective-c opencv cocoapods objective-c++


【解决方案1】:

你可以去https://cocoapods.org/搜索“uses:opencv”。这将向您展示其他依赖于 OpenCV 的库。从结果中,您可以检查每个库的“查看 Podspec”链接(在右下角),看看他们是如何做到的。例如here 是 CaptchaFace 的 podspec。

希望对你有所帮助!

【讨论】:

  • 我遵循了这些 podspec 文件。当我将 opencv 导入到我的 pod 中的任何文件时,它仍然得到相同的错误。谢谢。
【解决方案2】:

请将opencv目录添加到“Header Search Paths”

【讨论】:

  • 我在 podspec s.xcconfig = {'FRAMEWORK_SEARCH_PATHS' => '$(inherited) $(PODS_ROOT)/OpenCV', 'OTHER_LDFLAGS' => '-all_load'} 中添加了这段代码,但是这是行不通的。
猜你喜欢
  • 2018-09-29
  • 2016-03-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-11-20
  • 1970-01-01
  • 2021-03-11
相关资源
最近更新 更多