zoukankan      html  css  js  c++  java
  • xcode 编译opencv ios容易出现的错误

    (1)出现 "std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush()"之类的错误

    Undefined symbols for architecture i386:
      "std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush()", referenced from:
          cv::gpu::error(char const*, char const*, int, char const*) in opencv2(gpumat.o)
      "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from:
          std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<< <std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*) in opencv2(gpumat.o)
      "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry()", referenced from:
          std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<< <std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*) in opencv2(gpumat.o)
      "std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int)", referenced from:
          cv::gpu::error(char const*, char const*, int, char const*) in opencv2(gpumat.o)
      "std::__1::cerr", referenced from:

    解决办法是加入c++库 ,想项目中加入libc++.dylib

    1. Select your project (the blue file) in your project navigator (Command 1 if it's hidden)
    2. Select your target
    3. Go to Build Phases
    4. Expand "Link Binary With Libraries"
    5. Click the "+"
    6. Type libc++.dylib in the search bar.
    7. Select the libc++.dylib file and press "Add"

    (2)出现下面错误

    "_CVPixelBufferGetBaseAddress", referenced from:
          -[MainViewController imageFromSampleBuffer:] in MainViewController.o
      "_CVPixelBufferUnlockBaseAddress", referenced from:
          -[MainViewController imageFromSampleBuffer:] in MainViewController.o
      "_CVPixelBufferLockBaseAddress", referenced from:
          -[MainViewController imageFromSampleBuffer:] in MainViewController.o
      "_CMSampleBufferGetImageBuffer", referenced from:
          -[MainViewController imageFromSampleBuffer:] in MainViewController.o
      "_CVPixelBufferGetHeight", referenced from:
          -[MainViewController imageFromSampleBuffer:] in MainViewController.o
      "_kCVPixelBufferPixelFormatTypeKey", referenced from:
          _kCVPixelBufferPixelFormatTypeKey$non_lazy_ptr in MainViewController.o
         (maybe you meant: _kCVPixelBufferPixelFormatTypeKey$non_lazy_ptr)
      "_CVPixelBufferGetWidth", referenced from:
          -[MainViewController imageFromSampleBuffer:] in MainViewController.o
      "_CVPixelBufferGetBytesPerRow", referenced from:
          -[MainViewController imageFromSampleBuffer:] in MainViewController.o
      "_CMTimeMake", referenced from:
          -[MainViewController setupCaptureSession] in MainViewController.o
      "_CVPixelBufferGetDataSize", referenced from:
          -[MainViewController imageFromSampleBuffer:] in MainViewController.o

    解决方法是添加 AVFoundation , CoreVideo 和 CoreMedia frameworks 

    (3)出现下面错误assert错误时,需要添加AssetsLibrary.framework

  • 相关阅读:
    最新自然语言处理(NLP)四步流程:Embed->Encode->Attend->Predict
    Word Embedding
    知乎:GAN 的发展对于研究通用人工智能有什么意义?
    2016年总结:教师路的开启,爱情味的初尝 (下)
    WinForm 窗口缩放动画效果
    关于DrawIndexedPrimitive函数的调用
    spring mvc--默认都使用了哪些bean
    杭电 HDU 1031 Design T-Shirt
    Android选择/拍照 剪裁 base64/16进制/byte上传图片+PHP接收图片
    hdoj5645DZY Loves Balls
  • 原文地址:https://www.cnblogs.com/xiongqiangcs/p/3499638.html
Copyright © 2011-2022 走看看