将opencv引入私有pod,报错'opencv2/opencv.hpp' file not found

发布于 2022-09-04 17:53:25 字数 2723 浏览 32 评论 0

因为项目模块化需要,我想将之前项目的opencv以及一些分析算法单独制作一个pod.我的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

目前我测试的文件结构是
图片描述

结果build之后就报错了。
图片描述

有类似经历的童鞋吗???

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

胡渣熟男 2022-09-11 17:53:25

有没有在工程中添加到Link Framework?
试试将它添加到Embed framework去。

墨落画卷 2022-09-11 17:53:25

pod库哪里来的Embed framework呢???

想念有你 2022-09-11 17:53:25

请问这个问题解决了吗

神经大条 2022-09-11 17:53:25

你好,你的私有库添加opencv2问题解决了吗

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文