解决途径:
- F1
- C/C++: edit configurations(JSON)
生成 c_cpp_properties.json 文件 - 修改 c_cpp_properties.json文件,如4
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"D:/ProgramInstallFiles/OpenCV341/opencv_mingw64_build/install/include",
"D:/ProgramInstallFiles/OpenCV341/opencv_mingw64_build/install/include/opencv",
"D:/ProgramInstallFiles/OpenCV341/opencv_mingw64_build/install/include/opencv2"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "D:\\ProgramInstallFiles\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\gcc.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"configurationProvider": "vector-of-bool.cmake-tools",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
主要修改部分:在
“includePath”:
中添加mingw编译好的opencv lib path
“D:/ProgramInstallFiles/OpenCV341/opencv_mingw64_build/install/include”,
“D:/ProgramInstallFiles/OpenCV341/opencv_mingw64_build/install/include/opencv”,
“D:/ProgramInstallFiles/OpenCV341/opencv_mingw64_build/install/include/opencv2”
修改后: