Jump to content
Facebook Twitter Youtube

[Software]C/C++ for Visual Studio Code


Osiris
 Share

Recommended Posts

C/C++ support for Visual Studio Code is provided by a Microsoft C/C++ extension to enable cross-platform C and C++ development on Windows, Linux, and macOS. When you create a *.cpp file, the extension adds features such as syntax highlighting (colorization), smart completions and hovers (IntelliSense), and error checking.
 

C++ language features
         Install the extension
                         1- open vs code 
                                                                                                                                                                              2-Select the Extensions view icon on the Activity bar or use the keyboard shortcut (Ctrl+Shift+X)
                      3- Search for c++
                   4- select install

C/C++ extension
Set up your C++ Environment C++ is a compiled language meaning your program's source code must be translated (compiled) before it can be run on your computer. The C/C++ extension doesn't include a C++ compiler or debugger, since VS Code as an editor relies on command-line tools for the development workflow. You need to install these tools or use the tools already installed on your computer. Check if you have a compiler installed Note: There may already be a C++ compiler and debugger provided by your academic or work development environment. Check with your instructors or colleagues for guidance on installing the recommended C++ toolset (compiler, debugger, project system, linter). Common compilers that already come preinstalled on some platforms are the GNU Compiler Collection (GCC) on Linux and the Clang tools with Xcode on macOS. To check if you already have them installed: Open a new VS Code terminal window using (Ctrl+Shift+`) Use the following command to check for the GCC compiler g++: g++ --version Or this command for the Clang compiler clang: clang --version The output should show you the compiler version and details. If neither are found, make sure your compiler executable is in your platform path (%PATH on Windows, $PATH on Linux and macOS) so that the C/C++ extension can find it. Otherwise, use the instructions in the section below to install a compiler. Install a compiler If you don't have a compiler installed, you can follow one of our installation tutorials:
MYSS2 Installer
Example: Install MinGW-x64 on Windows To understand the process, let's install Mingw-w64 via MSYS2. Mingw-w64 is a po[CENSORED]r, free toolset on Windows. It provides up-to-date native builds of GCC, Mingw-w64, and other helpful C++ tools and libraries.  Download using this direct link to the MinGW installer.  Run the installer and follow the steps of the installation wizard. Note, MSYS2 requires 64 bit Windows 8.1 or newer.  In the wizard, choose your desired Installation Folder. Record this directory for later. In most cases, the recommended directory is acceptable. The same applies when you get to setting the start menu shortcuts step. When complete, ensure the Run MSYS2 now box is checked and select Finish. A MSYS2 terminal window will then automatically open.



Topic Source :https://code.visualstudio.com/docs/languages/cpp

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

WHO WE ARE?

CsBlackDevil Community [www.csblackdevil.com], a virtual world from May 1, 2012, which continues to grow in the gaming world. CSBD has over 70k members in continuous expansion, coming from different parts of the world.

 

 

Important Links