C/C++
Installation
-
Download
Visual Studio Build Tools 2022 Installerand run it -
Open
Visual Studio Build Tools 2022and check the following options
-
Go to
Single Componentsection -> search for ‘MSVC (v14.38-17.8)’ and check it -
Click
Install -
Edit
System Environment Variableswith the following variables1[SYS] BuildTools: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools2[SYS] VCTools: %BuildTools%\VC\Tools34[SYS] MSVC_VERSION: 14.42.344335[SYS] WIN_SDK_VERSION: 10.0.20348.06[SYS] WIN10KITS: C:\Program Files (x86)\Windows Kits\1078[SYS] INCLUDE: %VCTools%\MSVC\%MSVC_VERSION%\include;%WIN10KITS%\Include\%WIN_SDK_VERSION%\ucrt;%WIN10KITS%\Include\%WIN_SDK_VERSION%\um;%WIN10KITS%\Include\%WIN_SDK_VERSION%\shared;910[SYS] LIB: %WIN10KITS%\Lib\%WIN_SDK_VERSION%\um\x64;%WIN10KITS%\Lib\%WIN_SDK_VERSION%\ucrt\x64;%VCTools%\MSVC\%MSVC_VERSION%\lib\x64;1112[USER] Path:13%VCTools%\MSVC\%MSVC_VERSION%\bin\Hostx64\x6414%BuildTools%\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin
Configuration
-
Open Visual Studio Code
-
Ctrl + Shift + X-> Search for “C/C++” ->Install Specific Version...-> 1.21.6 (Versions before 1.22.9) -
Ctrl + Shift + X-> Search for “CMake Tools” -
Ctrl + Shift + P->Preferences: Open User Settings (JSON)-> Insert and set the following param:1{2"C_Cpp.intelliSenseEngineFallback": "enabled",3"C_Cpp.default.compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe", // Change to your compiler's path4"[cpp]": {5"editor.semanticHighlighting.enabled": true,6"editor.stickyScroll.defaultModel": "foldingProviderModel",7"editor.suggest.insertMode": "replace",8"editor.wordBasedSuggestions": "off"9},1011"cmake.generator": "Visual Studio 17 2022", // Change to your cmake's generator12"cmake.cmakePath": "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe", // Change to your cmake's path13"cmake.pinnedCommands": [14"workbench.action.tasks.configureTaskRunner",15"workbench.action.tasks.runTask"16],17}
Run Example
Beginner
-
Open Visual Studio Code
-
(Optional)
Ctrl + Shift + P->C/C++: Edit Configurations (JSON)-> Add custom include dirs to “includePath” -
Create a cpp file and write something
-
Press
F5and choose the configuration start with “C/C++“
Intermediate
-
Open Visual Studio Code
-
(Optional)
Ctrl + Shift + P->C/C++: Edit Configurations (JSON)-> Add custom include dirs to “includePath” -
Create a cpp file and write something (and create a header file inside ‘include/’ directory if you want)
-
(Optional)
Ctrl + Shift + P->Preferences: Open Workspace Settings (JSON)-> Insert and set the following param:1{2"cmake.configureOnOpen": false,3"cmake.sourceDirectory": "${workspaceFolder}/", // Change to the dir where CMakeLists.txt will be stored4} -
Create a
CMakeLists.txtif not exists1# Requiries2cmake_minimum_required(VERSION 3.16)3set(CMAKE_CXX_STANDARD 17)45# Set project name6project(name_of_the_project)7# # Set header directories8# include_directories(${PROJECT_SOURCE_DIR}/include)9# Set output directory10set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)1112# Collect source files13aux_source_directory(${PROJECT_SOURCE_DIR}/src SRC_LIST)1415# Create executable16add_executable(17name_of_the_exe18${SRC_LIST}19) -
Ctrl + Shift + P->CMake: Select a Kit-> Choose the kit starts with “Visual Studio” -
Ctrl + Shift + P->CMake: Configure-> Select the designated CMakeLists.txt
C#
Installation
Download Microsoft .NET SDK 8.0.411 Installer and run it
The following components should be installed:
- .NET SDK 8.0.411
- .NET Runtime 8.0.17
- ASP.NET Core Runtime 8.0.17
- .NET Windows Desktop Runtime 8.0.17
Configuration
-
Open Visual Studio Code
-
Ctrl + Shift + X-> Search for “C#” ->Install -
Ctrl + Shift + P->Preferences: Open User Settings (JSON)-> Insert and set the following params:1{2"omnisharp.useModernNet": false,3"dotnetAcquisitionExtension.allowInvalidPaths": true,4"dotnetAcquisitionExtension.existingDotnetPath": [], // Change to your dotnet's path5}
Python
Installation
…
Configuration
-
Open Visual Studio Code
-
Ctrl + Shift + X-> Search for “C#” ->Install -
Ctrl + Shift + P->Preferences: Open User Settings (JSON)-> Insert and set the following params:1{2"python.defaultInterpreterPath": "C:/Users/Spr_Aachen/AppData/Local/Programs/Python/Python39/python.exe", // Change to your interpreter's path3"[python]": {4"diffEditor.ignoreTrimWhitespace": false,5"editor.formatOnType": true,6"editor.wordBasedSuggestions": "off"7},8}
Common
Other recommanded settings for Visual Studio Code
-
Open Visual Studio Code
-
Ctrl + Shift + P->Preferences: Open User Settings (JSON)-> Insert the following params:1{2"update.enableWindowsBackgroundUpdates": false,34"terminal.integrated.defaultProfile.windows": "Command Prompt",56"security.workspace.trust.untrustedFiles": "open",78"editor.formatOnType": true,9"editor.formatOnPaste": true,10"editor.maxTokenizationLineLength": 100000,1112"diffEditor.experimental.showMoves": true,13"diffEditor.ignoreTrimWhitespace": false,14"diffEditor.maxComputationTime": 0,1516"git.suggestSmartCommit": true,1718"files.autoGuessEncoding": true,1920"workbench.startupEditor": "none",21"workbench.editor.empty.hint": "text",22}
Some information may be outdated