├── README.md ├── launch.json ├── c_cpp_properties.json └── tasks.json /README.md: -------------------------------------------------------------------------------- 1 | # opencv-configuration-with-vscode 2 | The configuration files of Opencv(c++) with Visual Studio Code(VS Code) 3 | 4 | Enviroment: win10 x86 5 | 6 | Requirements: 7 | 1. VS Code with c/c++ extensions (ms-vscode.cpptools) 8 | 2. Download MinGW-w64 (64 bit) 9 | 3. Download opencv OpenCV-MinGW-Build(https://github.com/huihut/OpenCV-MinGW-Build) 10 | 4. Add C:\mingw64\bin and C:\OpenCV-MinGW-Build\bin into PATH 11 | 5. Configuration with .vscode files in this repository 12 | 13 | Remark that the paths in the .vscode files might be different 14 | -------------------------------------------------------------------------------- /launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "(gdb) Launch", 6 | "type": "cppdbg", 7 | "request": "launch", 8 | "program": "${workspaceRoot}/${fileBasenameNoExtension}.exe", 9 | "args": [], 10 | "stopAtEntry": false, 11 | "cwd": "${workspaceRoot}", 12 | "environment": [], 13 | "externalConsole": true, 14 | "MIMode": "gdb", 15 | "miDebuggerPath": "C:\\mingw64\\bin\\gdb.exe",//"C:\\MinGW\\bin\\gdb.exe", 16 | "setupCommands": [ 17 | { 18 | "description": "Enable pretty-printing for gdb", 19 | "text": "-enable-pretty-printing", 20 | "ignoreFailures": true 21 | } 22 | ], 23 | "preLaunchTask": "build" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32", 5 | "compilerPath": "C:\\mingw64\\bin\\x86_64-w64-mingw32-g++.exe", 6 | "includePath": [ 7 | "${workspaceRoot}", 8 | "C:\\mingw64\\include", 9 | "C:\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\8.1.0\\include", 10 | "C:\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\8.1.0\\include\\c++", 11 | "C:\\OpenCV-MinGW-Build\\include" 12 | ], 13 | "defines": [ 14 | "_DEBUG", 15 | "UNICODE", 16 | "__GNUC__=5", 17 | "__cdecl=__attribute__((__cdecl__))" 18 | ], 19 | "intelliSenseMode": "clang-x64", 20 | "browse": { 21 | "path": [ 22 | "${workspaceRoot}", 23 | "C:\\mingw64\\include", 24 | "C:\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\8.1.0\\include", 25 | "C:\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\8.1.0\\include\\c++", 26 | "C:\\OpenCV-MinGW-Build\\include" 27 | ], 28 | "limitSymbolsToIncludedHeaders": true, 29 | "databaseFilename": "" 30 | } 31 | } 32 | ], 33 | "version": 4 34 | } 35 | -------------------------------------------------------------------------------- /tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "type": "shell", 7 | "command": "g++", 8 | "args": [ 9 | "-g", 10 | "${file}", 11 | "-o", 12 | "${fileBasenameNoExtension}.exe", 13 | "-I","C:\\OpenCV-MinGW-Build\\include", 14 | "-L","C:\\OpenCV-MinGW-Build\\x64\\mingw\\bin", 15 | "-l","libopencv_calib3d341", 16 | "-llibopencv_core341", 17 | "-llibopencv_dnn341", 18 | "-llibopencv_features2d341", 19 | "-llibopencv_flann341", 20 | "-llibopencv_highgui341", 21 | "-llibopencv_imgcodecs341", 22 | "-llibopencv_imgproc341", 23 | "-llibopencv_ml341", 24 | "-llibopencv_objdetect341", 25 | "-llibopencv_photo341", 26 | "-llibopencv_shape341", 27 | "-llibopencv_stitching341", 28 | "-llibopencv_superres341", 29 | "-llibopencv_video341", 30 | "-llibopencv_videoio341", 31 | "-llibopencv_videostab341" 32 | ], 33 | "group": { 34 | "kind": "build", 35 | "isDefault": true 36 | } 37 | } 38 | ] 39 | } 40 | --------------------------------------------------------------------------------