zoukankan      html  css  js  c++  java
  • (OS X) OpenCV架构x86_64的未定义符号:错误(OpenCV Undefined symbols for architecture x86_64: error)

    原地址:
    http://www.it1352.com/474798.html

    错误提示如下:

    Undefined symbols for architecture x86_64:
      "cv::_InputArray::_InputArray(cv::Mat const&)", referenced from:
          _main in test-41a30e.o
      "cv::namedWindow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
          _main in test-41a30e.o
      "cv::destroyWindow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
          _main in test-41a30e.o
      "cv::Mat::deallocate()", referenced from:
          cv::Mat::release() in test-41a30e.o
      "cv::imread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
          _main in test-41a30e.o
      "cv::imshow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&)", referenced from:
          _main in test-41a30e.o
      "cv::waitKey(int)", referenced from:
          _main in test-41a30e.o
      "cv::fastFree(void*)", referenced from:
          cv::Mat::~Mat() in test-41a30e.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    解决方法:

    brew install pkg-config
    brew reinstall opencv
    # 加入如下参数编译
    g++ $(pkg-config --cflags --libs opencv) test.cpp -o Test 
    # 运行程序
    ./Test
    
  • 相关阅读:
    sql查询语句
    java网络编程实现两端聊天
    Thread和Runnable的子类调用
    接口和抽象类
    ObjectOutputStream和ObjectInputStream的简单使用
    HashMap遍历和使用
    InputStreamReader读取文件出现乱码
    Neural Network
    Logistic Regression 逻辑回归
    Linear Regression 线性回归
  • 原文地址:https://www.cnblogs.com/theodoric008/p/9262395.html
Copyright © 2011-2022 走看看