Problemas com o VsCode no Linux Ubuntu ?

 


Uso o Clang no c/c++, mas o gcc é mais compatível, ultimamente tive problemas com o compilar o VsCode não o identificava. Logo fui ao confessor "Google Gemini", e perguntei "Kubuntu 20.04.06, gcc c/c++ works on terminal, but ins vscode there is a problem with path of compiler" , indicaram o seguinte : Pedem o pacote gdb.

In VS Code on Ubuntu/Kubuntu, if GCC/G++ works in the terminal but fails inside VS Code, the IDE is unable to locate the executable paths or header include paths in its configuration files.


1. Point the C/C++ Extension to standard system paths

Open VS Code in your project directory.
Press Ctrl + Shift + P to open the Command Palette.
Type and select C/C++: Edit Configurations (UI).
Scroll to Compiler path and enter:

For C: /usr/bin/gcc
For C++: /usr/bin/g++

Set IntelliSense mode to linux-gcc-x64.

This updates .vscode/c_cpp_properties.json inside your project workspace.

Launching VS Code from an active terminal inherits your shell's full $PATH.


Missing build environment headers: Ensure build-essential is fully installed across system paths:

Bash
sudo apt update && sudo apt install build-essential gdb

RM


Comentários