|
|
[[_TOC_]]
|
|
|
|
|
|
## Installation
|
|
|
Visual Studio Code is not part of the DevEnv and therefore it must be downloaded and installed in your machine.
|
|
|
Once downloaded from https://code.visualstudio.com/download it can be installed by:
|
|
|
|
|
|
```
|
|
|
>tar -xf code-stable-x64-1648620864.tar.gz
|
|
|
>mv VSCode-linux-x64/ VSCode-2022
|
|
|
>chmod -R 775 VSCode-2022/
|
|
|
>cd VSCode-2022/bin
|
|
|
>./code
|
|
|
```
|
|
|
|
|
|
## Configuration
|
|
|
Configuration of the include paths can be done by creating a c_cpp_properties.json file in the project directory:
|
|
|
|
|
|
```
|
|
|
{
|
|
|
"configurations": [
|
|
|
{
|
|
|
"name": "Linux",
|
|
|
"includePath": [
|
|
|
"${workspaceFolder}/**",
|
|
|
"${env:INTROOT}/**",
|
|
|
"/opt/rh/gcc-toolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/**",
|
|
|
"/opt/rh/gcc-toolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/x86_64-redhat-linux/**",
|
|
|
"/opt/rh/gcc-toolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/backward/**",
|
|
|
"/opt/rh/gcc-toolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/include/**",
|
|
|
"/usr/local/include/**",
|
|
|
"/opt/rh/gcc-toolset-9/root/usr/include/**",
|
|
|
"/usr/include/**",
|
|
|
"/opt/protobuf/include/**",
|
|
|
"/elt/mal/include/**",
|
|
|
"/opt/boost/include/**",
|
|
|
"/opt/log4cplus/include/**",
|
|
|
"/opt/cpp-netlib-uri/include/**",
|
|
|
"/opt/opentracing/opentracing-cpp-1.6.0/include/**",
|
|
|
"/opt/zeromq/include/**",
|
|
|
"/opt/open62541/include/open62541/**",
|
|
|
"/opt/anaconda3/include/python3.7m/**",
|
|
|
"/opt/hiredis/include/hiredis/**",
|
|
|
"/opt/azmq/include/**",
|
|
|
"/elt/**"
|
|
|
],
|
|
|
"defines": [],
|
|
|
"compilerPath": "/usr/bin/gcc",
|
|
|
"cStandard": "c17",
|
|
|
"cppStandard": "c++17",
|
|
|
"intelliSenseMode": "linux-clang-x64"
|
|
|
}
|
|
|
],
|
|
|
"version": 4
|
|
|
}
|
|
|
```
|
|
|
|
|
|
## Build
|
|
|
The building of the project can be done by creating a task.json file in the project directory:
|
|
|
|
|
|
```
|
|
|
{
|
|
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
|
|
// for the documentation about the tasks.json format
|
|
|
"version": "2.0.0",
|
|
|
"tasks": [
|
|
|
{
|
|
|
"label": "waf",
|
|
|
"type": "shell",
|
|
|
"command": "waf build",
|
|
|
"problemMatcher": [
|
|
|
"$gcc"
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
|
|
|
and by creating a settings.json file in the project directory (TBC if it is really needed):
|
|
|
|
|
|
```
|
|
|
{
|
|
|
"C_Cpp.default.compileCommands": "waf build",
|
|
|
"files.associations": {
|
|
|
"functional": "cpp"
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
|
|
|
## Debugging
|
|
|
An application can be debugged by creating a launch.json file in the project directory:
|
|
|
|
|
|
```
|
|
|
{
|
|
|
"version": "0.2.0",
|
|
|
"configurations": [
|
|
|
{
|
|
|
"name": "Debug ciiServer",
|
|
|
"type": "cppdbg",
|
|
|
"request": "launch",
|
|
|
"program": "${workspaceFolder}/build/rad/cpp/_examples/exciiserver/exCiiServer",
|
|
|
"args": [
|
|
|
"-cconfig/exciiserver/config.yaml",
|
|
|
"-lDEBUG"
|
|
|
],
|
|
|
"stopAtEntry": false,
|
|
|
"cwd": "${workspaceFolder}",
|
|
|
"environment": [],
|
|
|
"externalConsole": false,
|
|
|
"MIMode": "gdb",
|
|
|
"setupCommands": [
|
|
|
{
|
|
|
"description": "Enable pretty-printing for gdb",
|
|
|
"text": "-enable-pretty-printing",
|
|
|
"ignoreFailures": true
|
|
|
}
|
|
|
],
|
|
|
"miDebuggerPath": "/opt/rh/gcc-toolset-9/root/usr/bin/gdb"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
``` |
|
|
\ No newline at end of file |