'Visual Studio Code does not see libraries installed on the system

I'm trying to use boost libraries when working with Visual Studio Code.

VS code editor can't find boost headers, and the code won't compile.

I've installed boost with sudo apt install libboost-dev.

The boost libraries are located in /usr/include, and I've added it to my active configuration.

When I go to terminal, I can see the libraries in that directory, however, when I open Visual Studio Code's terminal, and go to /usr/include, boost libraries are not there. And, also, that terminal can't find apt command.

Observation from terminal: terminal

Observation from VS Code's terminal: vs code's terminal

To me it looks like VS Code is running in some sort of sandbox.

When I start vscode, it runs with command

/app/extra/vscode/code --extensions-dir=/home/user/.var/app/com.visualstudio.code/data/vscode/extensions --reuse-window --no-sandbox

How do I disable the sandbox mode or install the libraries I need inside that sandbox?



Solution 1:[1]

I have solved the issue by re-installing the Visual Studio Code. In pop shop, there are 2 versions of the program. First (and default) is from flathub, which is one I had installed and one that wasn't able to find boost. The other is for Pop Os (deb), and that version works fine. I was having the issue because I didn't notice the difference when installing

Solution 2:[2]

This worked for me.

Just close VSCode completely. Make sure it's not hanging somewhere in memory. And then reopen it. Your libraries should show.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Arsen Zahray
Solution 2 Dankyi Anno Kwaku