Created
October 27, 2020 10:42
-
-
Save treastrain/f822c5e6f6a1b35dbf88f69fde83dad3 to your computer and use it in GitHub Desktop.
Visual Studio Code から SSH 接続した Raspberry Pi 4 Model B で OpenCV を含む C++ プロジェクトを作成した際の各 json ファイル
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"configurations": [ | |
{ | |
"name": "Linux", | |
"includePath": [ | |
"${workspaceFolder}/**", | |
"/usr/local/include/opencv4" | |
], | |
"defines": [], | |
"compilerPath": "/usr/bin/clang", | |
"cStandard": "c17", | |
"cppStandard": "c++17", | |
"intelliSenseMode": "clang-arm" | |
} | |
], | |
"version": 4 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// IntelliSense を使用して利用可能な属性を学べます。 | |
// 既存の属性の説明をホバーして表示します。 | |
// 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "clang++ - アクティブ ファイルのビルドとデバッグ", | |
"type": "lldb", | |
"request": "launch", | |
"program": "${fileDirname}/${fileBasenameNoExtension}", | |
"args": [], | |
// "stopAtEntry": true, | |
"cwd": "${workspaceFolder}", | |
// "environment": [], | |
// "externalConsole": false, | |
// "MIMode": "lldb", | |
/* | |
"setupCommands": [ | |
{ | |
"description": "gdb の再フォーマットを有効にする", | |
"text": "-enable-pretty-printing", | |
"ignoreFailures": true | |
} | |
], | |
*/ | |
"preLaunchTask": "C/C++: clang++ build active file with OpenCV", | |
// "miDebuggerPath": "/usr/bin/lldb-mi" | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <opencv2/opencv.hpp> | |
#include <string> | |
using namespace std; | |
void printOpenCVVersion() { | |
cout << "OpenCV version : " << CV_VERSION << endl; | |
cout << "Major version : " << CV_MAJOR_VERSION << endl; | |
cout << "Minor version : " << CV_MINOR_VERSION << endl; | |
cout << "Subminor version : " << CV_SUBMINOR_VERSION << endl; | |
} | |
int main(int argc, char* argv[]) { | |
cout << "Hello, happy world!" << endl; | |
printOpenCVVersion(); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.formatOnSave": true, | |
"editor.formatOnType": true, | |
"C_Cpp.clang_format_style": "{BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 100}", | |
"files.associations": { | |
"iostream": "cpp" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"type": "cppbuild", | |
"label": "C/C++: clang++ build active file with OpenCV", | |
"command": "/usr/bin/clang++", | |
"args": [ | |
"-std=c++17", | |
"-g", | |
"${file}", | |
"-o", | |
"${fileDirname}/${fileBasenameNoExtension}", | |
"-I/usr/local/include/opencv4", | |
"-L/usr/local/lib/opencv4", | |
"-lopencv_core" | |
], | |
"options": { | |
"cwd": "/usr/bin" | |
}, | |
"problemMatcher": [ | |
"$gcc" | |
], | |
"group": { | |
"kind": "build", | |
"isDefault": true | |
}, | |
"detail": "compiler: /usr/bin/clang++" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment