+ All Categories
Home > Documents > 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run...

1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run...

Date post: 18-Jan-2018
Category:
Upload: amelia-fowler
View: 221 times
Download: 0 times
Share this document with a friend
Description:
Getting Visual Studio You can download Visual Studio 2015 Community Edition for free from the Microsoft web site. See the class web site for details: 3
42
1 Getting Started with C++ Part 1 Windows
Transcript
Page 1: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

1

Getting Started with C++

Part 1Windows

Page 2: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

2

Objective

You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft Visual Studio.

Page 3: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Getting Visual Studio You can download Visual Studio 2015

Community Edition for free from the Microsoft web site.

See the class web site for details:http://www.cse.usf.edu/~turnerr/Object_Oriented_Design/

3

Page 4: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

4

Start Up Visual Studio

Page 5: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

5

Visual Studio Projects A project in Visual Studio is a container

for all of the files needed to compile, execute, and debug a program.

A solution is a collection of one or more projects.

Our solutions will only have a single project. So a solution and a project will be essentially

equivalent in this course. Each will hold a single program.

Page 6: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

6

Start Up Visual StudioClick

Page 7: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

7

Ready to Create a Project

Click on the File menu and select New, then Project

Page 8: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Creating Your First C++ Project in Visual Studio

When you create your first C++ project after installing Visual Studio, Visual Studio will do some extensive updates. Can take 5 or 10 minutes (maybe more)

Click on the File menu and select New, then Project

8

Page 9: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

9

Creating Your First C++ Project in Visual Studio

Page 10: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Creating Your First C++ Project in Visual Studio

10

Expand the Visual C++ node in the left panel.Then click on Windows.Then select Install Universal Windows Platform ...And click OK.

Page 11: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Creating Your First C++ Project in Visual Studio

11

Click Install

You will only need to do this once.

Page 12: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Creating Your First C++ Project in Visual Studio

12Click Continue

Page 13: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Free up disk space if necessary

13

Page 14: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Creating Your First C++ Project in Visual Studio

14

Page 15: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Creating Your First C++ Project in Visual Studio

15Retry

Page 16: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Creating Your First C++ Project in Visual Studio

16

Page 17: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Creating Your First C++ Project in Visual Studio

17

Page 18: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Creating Your First C++ Project in Visual Studio

18

Page 19: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Creating Your First C++ Project in Visual Studio

19Click Close

Page 20: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Try Again

20

Restart Visual Studio if necessary

Page 21: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

21

Creating a C++ Project in Visual Studio

Click

Page 22: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

22

Creating a C++ Project in Visual Studio

Click

Page 23: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

23

Start with an Empty Project

Click

Click

Page 24: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

24

We Have a Project

Page 25: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

25

Adding a Source File to the Project

Page 26: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

26

Adding a Source File to the Project

Click

Page 27: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

27

It's Open in the Editor

Page 28: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

28

Add the Program Code

Save the file.

Page 29: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

29

View the Solution Explorer

Page 30: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

30

Solution Explorer Window

Page 31: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

31

Compile and Link the Program

Page 32: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

The Build was Successful

32

Page 33: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

33

Run the ProgramClick here to build and run

Page 34: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

34

Program "hello.cpp" in Action

Press "Enter" to end program and close window.

Page 35: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

35

Running Without the IDE

We can double click here to run the program independently of the IDE.

Here is the exe file.

Page 36: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Running Without the IDE

36

Page 37: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Running from the Desktop Drag the hello.exe icon to the

desktop.

Double click the icon to run the program from the desktop.

37

Page 38: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

38

Running Without the IDE

We can also run the program from the DOS command line.

Copy the exe file into a convenient directory (e.g. C )

Open a command window Click Start and search for cmd

cd to the directory Type the command: hello

Page 39: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

39

Running from the Command Line

Page 40: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

40

Creating a Shortcut

Page 41: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

Put the shortcut on the desktop

41

Page 42: 1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.

42

Running by Double Clicking

Now you can run the program by double clicking the icon on the desktop.


Recommended