I am using the C/C++ Extension for VS Code to write OpenCV code on Ubuntu 18.04. I have configured my c_cpp_properties.json
file like this:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"/usr/local/include/opencv4/opencv2/**",
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/g++",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
I want it to reference the OpenCV header files from the location /usr/local/include/opencv4/opencv2/
; but every time I 'Go to Definition' of any of the OpenCV code I've written, it takes me to header files from the folder /usr/include/opencv2/
, which contains code from an older OpenCV version. Because of this, I am unable to use certain newer features that I require.
我不想删除第二个位置的头文件,因为这些文件很可能是在安装ROS时安装的,并且我不想中断ROS的安装。我只希望VS Code从我指定的位置引用头文件,就像应该的那样。