<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ACharLuk</title>
    <description>The latest articles on DEV Community by ACharLuk (@acharluk).</description>
    <link>https://dev.to/acharluk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F14913%2F3e6f5ac3-22b1-4441-8e24-bb6a155bdbdc.jpg</url>
      <title>DEV Community: ACharLuk</title>
      <link>https://dev.to/acharluk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/acharluk"/>
    <language>en</language>
    <item>
      <title>Developing C++ with Visual Studio Code</title>
      <dc:creator>ACharLuk</dc:creator>
      <pubDate>Wed, 01 Aug 2018 14:44:59 +0000</pubDate>
      <link>https://dev.to/acharluk/developing-c-with-visual-studio-code-4pb9</link>
      <guid>https://dev.to/acharluk/developing-c-with-visual-studio-code-4pb9</guid>
      <description>&lt;p&gt;Welcome to my first post! I will be showing you how I develop C++ using &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt; along with the &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools" rel="noopener noreferrer"&gt;C++&lt;/a&gt; and &lt;a href="https://marketplace.visualstudio.com/items?itemName=ACharLuk.easy-cpp-projects" rel="noopener noreferrer"&gt;Easy C++ Projects&lt;/a&gt; extensions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Downloading Visual Studio Code
&lt;/h2&gt;

&lt;p&gt;First we will need a code editor or IDE, I personally like Visual Studio Code (VSC for short) because it is lightweight like Sublime, but has some of the features I like from IDEs, specially Intellisense. You can download Visual Studio Code &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;here&lt;/a&gt;, you will land on a page like this:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuh6c1u80xcfnt16hptc5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuh6c1u80xcfnt16hptc5.png" width="800" height="427"&gt;&lt;/a&gt;&lt;br&gt;
Click the download button and wait a few seconds for the download to start.&lt;/p&gt;




&lt;h2&gt;
  
  
  Setting up VSC for C++ development
&lt;/h2&gt;

&lt;p&gt;The first time you open VSC you will see a welcome window. VSC has a very simple layout: a bar on the left with 5 buttons (File explorer, Find, Git integration, Debug, Extensions), a status bar on the bottom and a window with tabs for the editors. Click the last button to open Extensions:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzz9dmkl0t5x1qlseyet2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzz9dmkl0t5x1qlseyet2.png" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To develop C++ we will install two extensions, the first one is C/C++, which is already shown in the last figure, to install it just click the green button that says &lt;code&gt;Install&lt;/code&gt;:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ccblxmmo9nvnfzn5nfr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ccblxmmo9nvnfzn5nfr.png" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then we will search for "easy c++" and then install the extension called "Easy C++ Projects"&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkpw2llrml5m2gtdfjmq7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkpw2llrml5m2gtdfjmq7.png" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Environment setup finished
&lt;/h2&gt;

&lt;p&gt;After installing the extensions, a blue button will appear saying &lt;code&gt;Reload&lt;/code&gt;, clicking it will reload the window and activate the extensions we just installed, as shown here:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx1yqk532c6c56r5s8269.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx1yqk532c6c56r5s8269.png" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Good job! Now we have an environment for depeloping our first C++ project!&lt;/p&gt;




&lt;h1&gt;
  
  
  Creating our first C++ project with Visual Studio Code!
&lt;/h1&gt;

&lt;p&gt;After setting up VSC for C++ development, we just need to create a new project! This is done in a few steps:&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a folder for the project
&lt;/h2&gt;

&lt;p&gt;To set the folder for the project, go to File &amp;gt; Open folder (or press [Ctrl+K Ctrl+O]), a dialog like this will pop up:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxq5c93u968kn7wisuiu1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxq5c93u968kn7wisuiu1.png" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a new folder and press "Select folder", the dialog will close and the window will reload and open the folder we have created.&lt;/p&gt;




&lt;h2&gt;
  
  
  Creating a C++ project
&lt;/h2&gt;

&lt;p&gt;Press F1, a little window will appear with lots of different commands, search for "c++" and click "Create new C++ project":&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxlctwhpliz5a51t21l8q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxlctwhpliz5a51t21l8q.png" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we will be asked what compiler we want to use, look the Easy C++ extension page for information on how to setup a compiler for your operating system. I will use Windows Subsystem for Linux.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F20wo9blhyn0lc9mq77es.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F20wo9blhyn0lc9mq77es.png" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5vbaxd8wiwxbo781mb8i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5vbaxd8wiwxbo781mb8i.png" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Code!
&lt;/h2&gt;

&lt;p&gt;Now that we finished the creation step, VSC will generate the project structure for us, and open &lt;code&gt;main.cpp&lt;/code&gt; with some example code:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ktw6cw3iilcy3mksocr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ktw6cw3iilcy3mksocr.png" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To test that the project works press the &lt;code&gt;Build &amp;amp; Run&lt;/code&gt; button on the status bar, a terminal will open and it will compile and execute our program for the first time!&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj8vrtekyy044n7av73jd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj8vrtekyy044n7av73jd.png" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>cpp</category>
      <category>visualstudiocode</category>
    </item>
  </channel>
</rss>
