<p>I found a solution to work with VSCode, and use it for compilation.</p>
<ol>
<li><a href="https://code.visualstudio.com/docs/setup/linux" rel="nofollow noreferrer">Install</a> vscode on your machine, including the C/C++ development extension</li>
<li>Create a directory named <code>.vscode</code> in the root of bitcoin repository folder</li>
<li>Create a <code>.vscode/c_cpp_properties.json</code> file. This file contains the configuration for the C/C++ project, including compiler type and source path.</li>
<li>Create a <code>.vscode/tasks.json</code> file. This file contains configuration for build and test tasks, which compiles the code and parses errors into the IDE</li>
<li>Hit <code>Ctrl+Shift+B</code> to run the build task</li>
</ol>
<p>If you want to develop on a Windows machine but build and run on a remote Linux machine, this can be done with the <a href="https://code.visualstudio.com/docs/remote/ssh-tutorial" rel="nofollow noreferrer">Remote Development</a> extension. After connecting to the remote server, create the relevant files in the directory.</p>
<p>The relevant json files:</p>
<p><strong><code>c_cpp_properties.json</code></strong></p>
<pre><code>{
    &quot;configurations&quot;: [
        {
            &quot;name&quot;: &quot;Linux&quot;,
            &quot;includePath&quot;: [
                &quot;${default}&quot;,
                &quot;${workspaceFolder}/src&quot;
            ],
            &quot;compilerPath&quot;: &quot;/usr/bin/gcc&quot;,
            &quot;cStandard&quot;: &quot;gnu17&quot;,
            &quot;cppStandard&quot;: &quot;gnu++17&quot;,
            &quot;intelliSenseMode&quot;: &quot;linux-gcc-x64&quot;,
            &quot;browse&quot;: {
                &quot;path&quot;: [
                    &quot;${workspaceFolder}/src&quot;
                ],
                &quot;limitSymbolsToIncludedHeaders&quot;: false,
                &quot;databaseFilename&quot;: &quot;${workspaceFolder}/.vscode/browse.vc.db&quot;
            }
        }
    ],
    &quot;version&quot;: 4
}
</code></pre>
<p><strong><code>tasks.json</code></strong></p>
<pre><code>{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    &quot;version&quot;: &quot;2.0.0&quot;,
    &quot;tasks&quot;: [
        {
            &quot;label&quot;: &quot;Build&quot;,
            &quot;type&quot;: &quot;shell&quot;,
            &quot;command&quot;: &quot;make -j 8&quot;,
            &quot;problemMatcher&quot;: {
                &quot;base&quot;: &quot;$gcc&quot;,
                &quot;fileLocation&quot;: [&quot;relative&quot;, &quot;${workspaceFolder}/src&quot;]
            },
            &quot;options&quot;: {
                &quot;cwd&quot;: &quot;${workspaceFolder}&quot;
            },
            &quot;group&quot;: {
                &quot;kind&quot;: &quot;build&quot;,
                &quot;isDefault&quot;: true
            }
        },
        {
            &quot;label&quot;: &quot;Test&quot;,
            &quot;type&quot;: &quot;shell&quot;,
            &quot;command&quot;: &quot;make check&quot;,
            &quot;problemMatcher&quot;: {
                &quot;base&quot;: &quot;$gcc&quot;,
                &quot;fileLocation&quot;: [&quot;relative&quot;, &quot;${workspaceFolder}/src&quot;]
            },
            &quot;options&quot;: {
                &quot;cwd&quot;: &quot;${workspaceFolder}&quot;
            },
            &quot;group&quot;: {
                &quot;kind&quot;: &quot;test&quot;,
                &quot;isDefault&quot;: true
            }
        },
        {
            &quot;label&quot;: &quot;Clean&quot;,
            &quot;type&quot;: &quot;shell&quot;,
            &quot;command&quot;: &quot;make clean&quot;,
            &quot;problemMatcher&quot;: {
                &quot;base&quot;: &quot;$gcc&quot;,
                &quot;fileLocation&quot;: [&quot;relative&quot;, &quot;${workspaceFolder}/src&quot;]
            },
            &quot;options&quot;: {
                &quot;cwd&quot;: &quot;${workspaceFolder}&quot;
            },
        },
    ]
}
</code></pre>

CC BY-SA 4.0
2021-11-03T14:26:45.457Z
2021-11-03T14:26:45.457Z
user107511
<p>Does anyone developing Bitcoin Core use VSCode for compilation and debugging on Linux/Ubuntu?</p>
<p>How can one configure VSCode to compile Bitcoin Core?</p>

CC BY-SA 4.0
2021-11-03T14:27:48.003Z
@Prayank see answer below
user107511
<bitcoin-core><ubuntu><compiling><source-code><debugging>
Building Bitcoin Core on Linux/Ubuntu with Visual Studio Code
user107511
# Building Bitcoin Core on Linux/Ubuntu with Visual Studio Code

(Asked by: username_0 on 2021-10-12)

Does anyone developing Bitcoin Core use VSCode for compilation and debugging on Linux/Ubuntu?

How can one configure VSCode to compile Bitcoin Core?

**Tags:** bitcoin-core, ubuntu, compiling, source-code, debugging

> **Comments:**
> **username_0**: @Prayank see answer below  

---

## 1 answers

### Answer by username_0 on 2021-11-03. Score: 3 | Accepted answer

I found a solution to work with VSCode, and use it for compilation.

1. [Install](https://code.visualstudio.com/docs/setup/linux) vscode on your machine, including the C/C++ development extension
2. Create a directory named `.vscode` in the root of bitcoin repository folder
3. Create a `.vscode/c_cpp_properties.json` file. This file contains the configuration for the C/C++ project, including compiler type and source path.
4. Create a `.vscode/tasks.json` file. This file contains configuration for build and test tasks, which compiles the code and parses errors into the IDE
5. Hit `Ctrl+Shift+B` to run the build task

If you want to develop on a Windows machine but build and run on a remote Linux machine, this can be done with the [Remote Development](https://code.visualstudio.com/docs/remote/ssh-tutorial) extension. After connecting to the remote server, create the relevant files in the directory.

The relevant json files:

**`c_cpp_properties.json`**

```
{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${default}",
                "${workspaceFolder}/src"
            ],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "gnu17",
            "cppStandard": "gnu++17",
            "intelliSenseMode": "linux-gcc-x64",
            "browse": {
                "path": [
                    "${workspaceFolder}/src"
                ],
                "limitSymbolsToIncludedHeaders": false,
                "databaseFilename": "${workspaceFolder}/.vscode/browse.vc.db"
            }
        }
    ],
    "version": 4
}

```

**`tasks.json`**

```
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build",
            "type": "shell",
            "command": "make -j 8",
            "problemMatcher": {
                "base": "$gcc",
                "fileLocation": ["relative", "${workspaceFolder}/src"]
            },
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "label": "Test",
            "type": "shell",
            "command": "make check",
            "problemMatcher": {
                "base": "$gcc",
                "fileLocation": ["relative", "${workspaceFolder}/src"]
            },
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "group": {
                "kind": "test",
                "isDefault": true
            }
        },
        {
            "label": "Clean",
            "type": "shell",
            "command": "make clean",
            "problemMatcher": {
                "base": "$gcc",
                "fileLocation": ["relative", "${workspaceFolder}/src"]
            },
            "options": {
                "cwd": "${workspaceFolder}"
            },
        },
    ]
}

```


---

