settings.json
中添加
"code-runner.executorMap": {
"cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt -std=c++11 `pkg-config --libs --static opencv4` `pkg-config --cflags opencv4` && $dir$fileNameWithoutExt"
},
c_cpp_properties.json
添加
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/local/include/opencv4"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
"/usr/local/include/opencv4"
为本机 OpenCV
的安装路径。
其余参考:
https://www.cnblogs.com/flyinggod/p/10867530.html
https://blog.csdn.net/fightfightfight/article/details/82857397