0% found this document useful (0 votes)
16 views83 pages

W4-Presentation-Setting Up My Environment

This document provides a step-by-step guide for setting up a development environment using GitHub, Visual Studio Code, and MinGW for C++ programming. It includes instructions for creating a GitHub account, creating a repository, downloading and installing Visual Studio Code and MinGW, and configuring the system path. Additionally, it covers downloading project templates and installing necessary extensions for Visual Studio Code.

Uploaded by

igcasan.jc07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views83 pages

W4-Presentation-Setting Up My Environment

This document provides a step-by-step guide for setting up a development environment using GitHub, Visual Studio Code, and MinGW for C++ programming. It includes instructions for creating a GitHub account, creating a repository, downloading and installing Visual Studio Code and MinGW, and configuring the system path. Additionally, it covers downloading project templates and installing necessary extensions for Visual Studio Code.

Uploaded by

igcasan.jc07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 83

Module 004

Setting up My Environment
Week 004: Setting up My Environment

Creating Github Account

Step 1:
To create your own
Github account you must
visit the GitHub, Inc.
website through the link
https://github.com/.
MicroEJ. (2015). MicroEJ and Github [Online Blog].
Retrieved from http://www.microej.com/microej-and-
github/
Week 004: Setting up My Environment

Creating Github Account

Step 2:
Click the “Sign up” link on
the upper right corner of
the page.
Week 004: Setting up My Environment

Creating Github Account

Step 3:
a. Enter your preferred
username, valid and
active email address,
and password.

b. Click “Create an
account” button.
Week 004: Setting up My Environment

Creating Github Account

Step 4:
a. Select “Unlimited
public repositories for
free”.
Leave the “Help me set
up an organization next”
checkbox unticked.

b. Click “Continue”
button.
Week 004: Setting up My Environment

Creating Github Account

Step 5:
a. Select the most
appropriate options
you desire. This
course will not limit
you on how you will
use your Github
account in the future.

b. Click “Submit” button.


Week 004: Setting up My Environment

Creating Github Account

Step 6:
You are now ready to
create your first Github
project.
Week 004: Setting up My Environment

Creating Github Repository

Step 1:
To create an initial repository:
a. If you do not have yet
any repository,
Click “Start a project”
button.

b. If you already have an


existing repository(-ies),
Click “New repository”
button.
Week 004: Setting up My Environment

Creating Github Repository

Step 2:
Enter “AMAOEd-
CompProg1-Week004”
(without spaces) in the
“Repository name” textbox.
Week 004: Setting up My Environment

Creating Github Repository

Step 3:
Enter “My very first C++
application.” in the
“Description (optional)”
textbox.
Week 004: Setting up My Environment

Creating Github Repository

Step 4:
Make sure the “Public”
checkbox is ticked.
Week 004: Setting up My Environment

Creating Github Repository

Step 5:
Tick the “Initialize this
repository with a README”
checkbox.
Week 004: Setting up My Environment

Creating Github Repository

Step 6:
Set the GitIgnore template:
a. Click the “Add .gitignore:
None” button.

b. Enter “C++” in the “Filter


ignores” textbox.

c. Click “C++” in the


typeahead.

d. Verify that the button


changes to “Add .gitignore:
C++”.
Week 004 Setting up My Environment

Creating Github Repository


Step 7:
Set the License template:
a. Click the “Add a license:
None” button.

b. Enter “GNU General Public


License v3.0” in the “Filter
licenses” textbox.

c. Click “GNU General Public


License v3.0” in the typeahead.

Verify that the button changes to


“Add a license: GNU General
Public License v3.0”.
Week 004: Setting up My Environment

Creating Github Repository

Step 8:
Verify that the fields are
correct and accurate.
Week 004: Setting up My Environment

Creating Github Repository

Step 9:
Click “Create repository”
button.
Week 004 Setting up My Environment

Creating Github Repository

Step 10:
You now have created your
Github repository for this
week’s activity.
Week 004: Setting up My Environment

Downloading Visual Studio Code

Step 1:
Visit the Visual Studio
Code official website at
https://code.visualstudio.co
m.

Visual Studio Code Official Website


Week 004: Setting up My Environment

Downloading Visual Studio Code

Step 2:
Click the “Download”
button.

Visual Studio Code Official Website


Week 004: Setting up My Environment

Downloading Visual Studio Code

Step 3:
Click the “[Download Icon]
Windows” button.
Week 004: Setting up My Environment

Downloading Visual Studio Code

Step 4:
Verify that the Download
page is displayed. Wait
until the download is
completed.
Week 004: Setting up My Environment

Downloading Visual Studio Code

Step 1:
Run the downloaded Visual
Studio Code installer (i.e.
VSCodeSetup-xxxx-x.x.x.exe).

a. Approve the necessary


security checkpoint if
necessary (for Admin rights
confirmation boxes).
Week 004 Setting up My Environment

Downloading Visual Studio Code

Step 2:
Click “Next” button.
Week 004: Setting up My Environment

Downloading Visual Studio Code

Step 3:
Read and accept the License
Agreement:
a. Tick the “I accept the
agreement” checkbox.
Click “Next” button.
Week 004: Setting up My Environment

Downloading Visual Studio Code

Step 4:
Use the default installation
directory:
a. For 32-bit Windows, the
directory should be
“C:\Program Files\Microsoft
VS Code”.

b. For 64-bit Windows, the


directory should be
“C:\Program Files
(x86)\Microsoft VS Code”.
Click “Next” button.
Week 004: Setting up My Environment

Downloading Visual Studio Code

Step 5:
Select the start menu folder,
a. Keep the value as is
“Visual Studio Code”.

b. Leave the “Don’t create a


Start Menu folder” checkbox
unticked.

c. Click “Next” button.


Week 004: Setting up My Environment

Downloading Visual Studio Code

Step 6:
Select additional tasks,
a. Leave the default
settings as is.

b. Click “Next” button.


Week 004: Setting up My Environment

Downloading Visual Studio Code

Step 7:
Verify installation tasks then
click “Install” button.
Week 004: Setting up My Environment

Downloading Visual Studio Code

Step 8:
Wait for the installation process
to complete.
Week 004: Setting up My Environment

Downloading Visual Studio Code

Step 9:
After the installation process
finishes, untick the “Launch
Visual Studio Code” checkbox.
Week 004: Setting up My Environment

Downloading Visual Studio Code

Step 10:
Click “Finish” button.

The installation process is now


completed.
Week 004: Setting up My Environment

Downloading Minimalist GNU for Windows

Step 1:
Visit the official website of
MinGW at
http://www.mingw.org/.
Week 004: Setting up My Environment

Downloading Minimalist GNU for Windows

Step 2:
Under Navigation pane (left
corner), click the “Downloads”
link.
Week 04: Setting up My Environment

Downloading Minimalist GNU for Windows

Step 3:
Click the link beside the text
“Looking for the latest version?”
(i.e. Download mingw-get-
setup.exe).
Week 004: Setting up My Environment

Downloading Minimalist GNU for Windows

Step 1:
Run the downloaded “mingw-
get-setup.exe” file.
a. Approve the necessary
security checkpoint if
necessary (for Admin rights
confirmation boxes).
Week 004: Setting up My Environment

Downloading Minimalist GNU for Windows

Step 2:
Click the “Install” button.
Week 004: Setting up My Environment

Downloading Minimalist GNU for Windows

Step 3:
Change the settings as
indicated:
a. Keep the “Installation
Directory” to
“C:\MinGW”.

b. Keep the rest of the


settings as is.
Click “Continue” button.
Week 004: Setting up My Environment

Downloading Minimalist GNU for Windows

Step 4:
The download process of its
components will proceed. Wait
until it finishes (i.e. 100%
progress).
a. After, click the “Continue”
button.
Week 004: Setting up My Environment

Downloading Minimalist GNU for Windows

Step 5:
The “MinGW Installation
Manager” will appear.
Week 004: Setting up My Environment

Installing MinGW Components

Step 1:
Open the “MinGW Installation
Manager” at
“C:\MinGW\bin\mingw-get.exe”.
Week 004: Setting up My Environment

Installing MinGW Components


Step 2:
Update the catalogue:
a. Click the “Installation” menu.
Click the “Update Catalogue”
option.

b. Verify that the “Update


Catalogue Dialog” is open.

c. Wait until the download process


is complete.

d. Click the “Close” button.


Week 004: Setting up My Environment

Installing MinGW Components

Step 3:
Set MinGW Base to install:
a. Click the checkbox
beside “mingw32-base”.

b. Click the “Mark for


Installation” option.

c. Verify that the checkbox


beside “ming32-base” is
now ticked.
Week 004: Setting up My Environment

Installing MinGW Components

Step 4:
Set C++ compiler to install:
a. Click the checkbox
beside “mingw32-gcc-
g++”.

b. Click the “Mark for


Installation” option.

c. Verify that the checkbox


beside “ming32-gcc-g++” is
now ticked.
Week 004: Setting up My Environment

Installing MinGW Components

Step 5:
Set Objective-C compiler to
install:
a. Click the checkbox
beside “mingw32-gcc-objc”.

b. Click the “Mark for


Installation” option.
Verify that the checkbox
beside “ming32-gcc-objc” is
now ticked.
Week 004: Setting up My Environment

Installing MinGW Components

Step 6:
Set Objective-C compiler to
install:
a. Click the checkbox beside
“mingw32-gcc-objc”.

b. Click the “Mark for


Installation” option.

c. Verify that the checkbox


beside “ming32-gcc-objc” is
now ticked.
Week 004: Setting up My Environment

Installing MinGW Components


Step 6:
Queue for installation:
a. Click the “Installation” menu.

b. Click the “Apply Changes” option.

c. Verify that the “Schedule of


Pending Actions” is displayed.

d. Click the “Apply” button.

e. This will take time. Wait for the


download process to complete.

f. Click the “Close” button.


Week 004: Setting up My Environment

Installing MinGW Components

Step 7:
Verify that the following have
a green checkbox:
a. mingw32-base
b. mingw32-gcc-g++
c. mingw32-gcc-objc
Week 004: Setting up My Environment

Installing MinGW Components

Step 8:
Manually close the “MinGW
Installation Manager”.
Week 004: Setting up My Environment

Configuring Microsoft Windows Path

Step 1:
Press the “[Windows Logo]
Windows” and the “Pause”
keys at the same time. This
will open the Windows
System window.
Week 004: Setting up My Environment

Configuring Microsoft Windows Path

Step 2:
Click the “Advanced System
Settings” link on the left pane
of the window to open the
System Properties dialog.
Week 004: Setting up My Environment

Configuring Microsoft Windows Path

Step 3:
Click the “Environment
Variables…” button.
Week 004: Setting up My Environment

Configuring Microsoft Windows Path

Step 4:
Under system variables,
locate and select the “Path”
variable.
Week 004: Setting up My Environment

Configuring Microsoft Windows Path

Step 5:
Click the “Edit” button.
Week 004: Setting up My Environment

Configuring Microsoft Windows Path


Step 6:
a. Add MinGW’s Bin folder as
entries:
For Windows 10:
i. Click the “New”
button.
ii. Enter
“C:\MinGW\bin” in the
textbox.
iii. Click the “OK”
button.
Week 004: Setting up My Environment

Configuring Microsoft Windows Path


Step 6:
b. For Windows 8.1 and earlier
versions:
i. Verify that the “Path”
value is displayed in the
“Variable name” textbox.
ii. In the “Variable value”
textbox, add the following
lines without the
quotations:
“;C:\MinGW\bin;” (take
note of the semi-colons
placed in front and at the
back of the file path.)
iii. Click the “OK” button.
Week 004: Setting up My Environment

Configuring Microsoft Windows Path


Step 7:
Click the “OK” button.
Week 004: Setting up My Environment

Configuring Microsoft Windows Path


Step 8:
Click the “OK” button to close
the System Properties
dialog.
Week 004: Setting up My Environment

Configuring Microsoft Windows Path


Step 9:
Close the Windows System
window.
Week 004: Setting up My Environment

Configuring Microsoft Windows Path


Step 10:
To test if you correctly
performed the steps:
a. Open a command
prompt.
b. Enter “g++ --version”.
c. Verify that the “g++
(GCC) 5.3.0” is displayed.
Week 004: Setting up My Environment

Downloading Project Templates for Visual Studio


Step 1:
In your user’s My Documents
(or Documents) folder, create
a new folder named
“Projects”. Note: This will
serve as our parent project
directory throughout the
course.
Week 004: Setting up My Environment

Downloading Project Templates for Visual Studio


Step 2:
Inside our project directory,
create a new folder
“AMAOEd-CompProg1-
Week004”. This is our Week
004 directory.
Week 004: Setting up My Environment

Downloading Project Templates for Visual Studio


Step 3:
Login to Github using your
account.
Week 004: Setting up My Environment

Downloading Project Templates for Visual Studio


Step 4:
Visit the Github repository,
https://github.com/JimAlvare
z/projects-templates. This
repository contains the
project templates for Visual
Studio Code, for one, which
covers the essential settings
we will need for the projects.
Week 004: Setting up My Environment

Downloading Project Templates for Visual Studio


Step 5:
Click the “Clone or download
(arrow down icon)” button.
Week 004: Setting up My Environment

Downloading Project Templates for Visual Studio


Step 6:
Click the “Download ZIP”
link.
Week 004: Setting up My Environment

Downloading Project Templates for Visual Studio


Step 7:
Extract the downloaded
archive to our parent project
directory.
Week 004: Setting up My Environment

Downloading Project Templates for Visual Studio


Step 8:
Copy the following folders
inside “projects-templates-
master\templates\vscode\c++”
folder to our Week 004
directory:
a. “.vscode”
b. “src”
Week 004: Setting up My Environment

Downloading Project Templates for Visual Studio


Step 9:
By this time, our “AMAOEd-
CompProg1-Week004” should
have two folders (i.e. “.vscode”
and “src”).
Week 004: Setting up My Environment

Adding C++ Extension to Visual Studio Code


Lastly, we need to install the
C/C++ Extension for Visual
Studio to support C and C++
applications.

Step 1:
Open Visual Studio Code.
Week 004: Setting up My Environment

Adding C++ Extension to Visual Studio Code


Step 2:
Click the “Extension
(CTRL+SHIFT+X)” icon on the
left pane.
Week 004: Setting up My Environment

Adding C++ Extension to Visual Studio Code


Step 3:
Enter “C/C++” in the textbox. A
list of extensions will be
displayed that supports C/C++.
Week 004: Setting up My Environment

Adding C++ Extension to Visual Studio Code


Step 4:
Select the first item with
“C/C++” purple icon.
Week 004: Setting up My Environment

Adding C++ Extension to Visual Studio Code


Step 5:
Click the “Install” icon of the
“C/C++” extension.
Week 004: Setting up My Environment

Hello World
Step 1:
Open Visual Studio Code.
Week 004: Setting up My Environment

Hello World
Open our project folder
“AMAOEd-CompProg1-
Week004”.

Step 2:
Under File menu, click “Open
Folder… [CTRL + K CTRL+O]”
option.
Week 004: Setting up My Environment

Hello World
Step 3:
Locate and select our
“AMAOEd-CompProg1-
Week004” folder.
Week 004: Setting up My Environment

Hello World
Step 4:
Click the “Select Folder” button.
Week 004: Setting up My Environment

Hello World
Step 5:
Verify that under the Explorer
pane (left side), there are two
folders available (i.e. “.vscode”
and “src” folders).
Week 004: Setting up My Environment

Hello World
Step 6:
There are times that Visual
Studio Code will download
several updates and packages
for our project. Let the
download complete first before
proceeding.
Week 004: Setting up My Environment

Hello World
Open our project folder
“AMAOEd-CompProg1-
Week004”.

Step 7:
In the code, under the TO DO
comments, add the line: cout
<< “Hello World”;
Week 004: Setting up My Environment

Hello World
Step 8:
This is case-sensitive. Do not
capitalize any part of the line
outside of the quotation marks.
The line ends with a semi-colon
(;).
Week 004: Setting up My Environment

Hello World
Build and run our application.

Step 9:
Click the “Debug
(CTRL+SHIFT+D)” icon.
Week 004: Setting up My Environment

Hello World
Step 10:
Click the “Start Debugging“
button with a green play icon.

You might also like