lab00-getting started with vc2005 1. launch vs 2005 launch visual studio 2005 – start > all...

18
Lab00-Getting Started with VC2005 1

Upload: allison-baker

Post on 06-Jan-2018

222 views

Category:

Documents


1 download

DESCRIPTION

Create Project - MyProject New Project – Create: Project Existing Project – Open: Project 3

TRANSCRIPT

Page 1: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

Lab00-Getting Started with VC2005

1

Page 2: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

Launch VS 2005

• Launch Visual Studio 2005– Start > All Programs > Microsoft Visual Studio

2005 > Microsoft Visual Studio 2005

– Select C++ Environment

2

Page 3: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

Create Project - MyProject

New Project – Create: ProjectExisting Project – Open: Project

3

Page 4: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

1) Make sure it is Visual C++

2) Select Win32

3) Select Win32 Console Application

4) Enter project name MyProject

5) Enter location

6) OK

4

Page 5: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

1) Select Console application

2) Select Empty Project

3) Finish

1) Next

5

Page 6: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

Create a .c file in MyProject

6

Right-click

Page 7: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

7

2) Select C++ File

3) Enter file name, e.g.: Lab1 – avoid space or . (dot)

4) Don’t change the location – the file will be kept in your project location

1) Make sure it is Visual C++

Page 8: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

8

EditorFile and Class Information

Message Window: Compilation and Error Message

Page 9: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

Write this code in Lab1.cpp

9

Page 10: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

Compile (Ctrl+F7) - compiling

10

Page 11: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

Check the Message Window

11

Page 12: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

If no error, Build Solution (F7) - Linking.

12

Page 13: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

13

Check the Message Window

Page 14: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

If no error, run your program (Ctrl+F5)

14

Page 15: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

Dealing with Compilation Error

15

1) Double click the first error

2) Arrow indicating line of error

Total no of error

Line number

If you copy code from Ms Word, and paste it in Visual Cdon’t forget to type again the quote symbol

Page 16: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

Show line number in VS

16

Tools > Options

Expand “Text Editor” > Select “C/C++” > Check Line numbers checkbox > OK

It is better to show line number.Easy for the lecturer to guide you where is the location of the errorby focusing on the line number

Page 17: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

Detach a file from workspace

17

Do not compile if there are more than 1 .c fileslisted in Source FilesYou need to remove the all file(s) except the file thatyou want to compile

Page 18: Lab00-Getting Started with VC2005 1. Launch VS 2005 Launch Visual Studio 2005 – Start > All Programs > Microsoft Visual Studio 2005 > Microsoft Visual

Attach an existing file from workspace

18