zoukankan      html  css  js  c++  java
  • 如何在macOS mojave上安装opencv4给vscode使用

    first, install opcv4, the newest one. but brew install opencv will only get a version 3,

    Another way is to use source code and compile it locally, but it's slow.

    My way is from https://gocv.io/getting-started/macos/

     then another pit is to include opencv header file:

    in vscode, there should be a c_cpp_properties.json

    add line 7

    in this folder, there's a folder /opencv4/opencv2/...

    here one easy way might be #include <opencv4/opencv2/...> all the time, but actually it will fail to some opcv's reasons.

    So we have to either move opencv2 folder to /include/ or do a soft link:

    ln -sf opencv4/opencv2 opencv2

    at last, when we are going to compile file including opencv, we should use:

    g++ -std=c++11 main.cpp -o a.out `pkg-config --cflags --libs opencv4`

    ## cautious: use opencv4 rather than opencv, because in /usr/local/lib/pkgconfig, there's only the file named opencv4.pc

  • 相关阅读:
    求算个十百输出
    求算反弹高度
    九九乘法表
    等腰三角形字母
    动态数码管
    静态数码管
    出错的程序操作
    EPLAN
    robotstudio smart组件解释
    eclipse插件安装方法
  • 原文地址:https://www.cnblogs.com/ecoflex/p/10213745.html
Copyright © 2011-2022 走看看