zoukankan      html  css  js  c++  java
  • Xcode下搭建opencv环境碰到的一些问题

    写了一学期py-opencv了都快结束了突然又要折腾起c++下来,真实给自己跪了,不过环境基本都搞定了,中间碰到了一些问题这里总结一下:

    1. usr/local/include和usr/local/lib的问题就不说了,编译之前要把头文件和动态库都连进去否则会产生dyld: Library not loaded的错误
    2. dyld: Library not loaded: cv2.so,有放到cv2.so檔案的, 則是要記得到Build Phases(project target下)內,把選項改為optional
    3. Undefined symbols for architecture x86_64:
      "cv::namedWindow(std::__1::basic_string, std::__1::allocator > const&, int)", referenced from:
    
          _main in main.o
    
      "cv::imread(std::__1::basic_string, std::__1::allocator > const&, int)", referenced from:
    
          _main in main.o
    
      "cv::imshow(std::__1::basic_string, std::__1::allocator > const&, cv::_InputArray const&)", referenced from:
    
          _main in main.o
    
    ld: symbol(s) not found for architecture x86_64
    
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    C++库和opencv库编译不一致,将XCode的C++ Standard Library改为GNU C++ standard library即可正常编译显示图片。Project Build settings -> APPLE LLVM compiler 4.2 - Language -> C++ Standard Library

  • 相关阅读:
    nginx:安装成windows服务
    org.aspectj.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18
    数据库中间件
    架构策略
    谈判
    设计模式 总结 常用10种
    08 状态模式 state
    07 策略模式 strategy
    06 命令模式(不用)
    05 观察者模式 Observer
  • 原文地址:https://www.cnblogs.com/sparkmorry/p/3527624.html
Copyright © 2011-2022 走看看