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

  • 相关阅读:
    day_10作业
    day_10
    day_09
    day_08
    猜年龄游戏
    day_07
    day_06作业
    day05课堂小结
    day05作业
    day04课堂小结
  • 原文地址:https://www.cnblogs.com/ecoflex/p/10213745.html
Copyright © 2011-2022 走看看