Ubuntu+Vscode+Opencv配置
2022/7/29 5:22:58
本文主要是介绍Ubuntu+Vscode+Opencv配置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
1.Vscode安装:
参考:https://blog.csdn.net/weixin_43793181/article/details/124456809
2.Opencv编译安装:
参考:https://blog.csdn.net/xiangfengl/article/details/122945924
3.Vscode配置Opencv:
三个json文件配置:launch.json、c_cpp_properties.json、tasks.json.Vscode Ctrl + Shift + P 打开搜索框,键入c++,会出现备选项目,选择图示Edit configurations (JSON),下拉分别选择3个json文件,输入以下配置即可:
launch.json: { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "g++ - Build and debug active file", "type": "cppdbg", "request": "launch", "program": "${fileDirname}/${fileBasenameNoExtension}", //程序文件路径 "args": [], //程序运行需传入的参数 "stopAtEntry": false, "cwd": "${fileDirname}", "environment": [], "externalConsole": true, //运行时是否显示控制台窗口 "MIMode": "gdb", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ], "preLaunchTask": "C/C++: g++ build active file", "miDebuggerPath": "/usr/bin/gdb" } ] }
c_cpp_properties.json: { "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/**", "/usr/local/include/opencv4" ], "defines": [], "compilerPath": "/usr/bin/gcc", "cStandard": "gnu11", "cppStandard": "gnu++14", "intelliSenseMode": "linux-gcc-x64" } ], "version": 4 }
task.json: { "tasks": [ { "type": "cppbuild", "label": "C/C++: g++ build active file", /* 与launch.json文件里的preLaunchTask的内容保持一致 */ "command": "/usr/bin/g++", "args": [ "-std=c++11", "-g", //"${file}", /* 编译单个文件 */ "${fileDirname}/*.cpp", /* 编译多个文件 */ "-o", "${fileDirname}/${fileBasenameNoExtension}", /* 输出文件路径 */ /* 项目所需的头文件路径 */ "-I","${workspaceFolder}/", "-I","/usr/local/include/", "-I","/usr/local/include/opencv4/", "-I","/usr/local/include/opencv4/opencv2", /* 项目所需的库文件路径 */ "-L", "/usr/local/lib", /* OpenCV的lib库 */ "/usr/local/lib/libopencv_*", ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true }, "detail": "Task generated by Debugger." } ], "version": "2.0.0" }
这篇关于Ubuntu+Vscode+Opencv配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-22怎么实现ansible playbook 备份代码中命名包含时间戳功能?-icode9专业技术文章分享
- 2024-11-22ansible 的archive 参数是什么意思?-icode9专业技术文章分享
- 2024-11-22ansible 中怎么只用archive 排除某个目录?-icode9专业技术文章分享
- 2024-11-22exclude_path参数是什么作用?-icode9专业技术文章分享
- 2024-11-22微信开放平台第三方平台什么时候调用数据预拉取和数据周期性更新接口?-icode9专业技术文章分享
- 2024-11-22uniapp 实现聊天消息会话的列表功能怎么实现?-icode9专业技术文章分享
- 2024-11-22在Mac系统上将图片中的文字提取出来有哪些方法?-icode9专业技术文章分享
- 2024-11-22excel 表格中怎么固定一行显示不滚动?-icode9专业技术文章分享
- 2024-11-22怎么将 -rwxr-xr-x 修改为 drwxr-xr-x?-icode9专业技术文章分享
- 2024-11-22在Excel中怎么将小数向上取整到最接近的整数?-icode9专业技术文章分享