Lab 1 Getting Started with Visual Studio 2019 Semester B 2021 - 22 Outline • Introduction and installation of Visual studio (VS) • Writing, compiling, and executing C++ programs using VS 2 Working Environment • In this course, you will be working with PC under Windows 10, and all the programs will be written with Visual Studio 2019 • In this lab, you will explore and get familiar with the MS Visual Studio 2019 compiler working environment. • Visual Studio 2019 is an integrated developing environment (IDE). Inside the Visual Studio 2019 compiler, you can edit , compile , link , run , debug and manage your programming projects. 3 Downloading a Visual C++ 2019 compilers (at home) – Windows only • Visual Studio 2019 can be found at: http://msdnaa.cs.cityu.edu.hk/ • (Note: The site may not work in some versions of Firefox) • Verify your CityU O365 account. • Select Visual Studio Enterprise 2019 • Download and run the executable files. • Click setup to install. 4 Enter the MSDNAA Software Center 5 Click this - Login using your CityU O365 account. Verify your student status (on Education >> Software page) 6 Click here then follow the instructions If your verification fails, you can download Visual Studio Community 2019 from https:// visualstudio.microsoft.com /vs/community/ for free Select Visual Studio Enterprise 2019 1:Select Visual Studio Enterprise 2019 7 If your verification fails, you can download Visual Studio Community 2019 from https:// visualstudio.microsoft.com /vs/community/ for free 3: Click Download 2: Save the product key for later activation Run the downloaded executable file to obtain the Visual Studio Installer 8 Select useful workloads 9 1: Select Desktop development with C++ 2: Click Install 10 Open VS2019 and Sign in with your CityU 360 account Click Sign in 11 Activate Visual Studio Enterprise 2019 3: Enter your pre - saved product key 1 : Go to Account setting 2: Click This For Mac or Linux users As for Linux users, you can use CLion , which is a Cross - Platform IDE for C and C++ by JetBrains. Students can get the education support by registering with school email for free use of CLion (recommended.) Another alternative is Visual Studio Code : Reference: https://code.visualstudio.com/docs/languages/cpp https://code.visualstudio.com/docs/editor/debugging It is also very convenient to use command line with g++ to compile and run . cpp files. Details could be found in the (optional) references on Canvas 12 How to start Visual Studio in CS labs • Locate and double click Microsoft Visual Studio 2019 Enterprise in CSLab Manu on Desktop 13 Outline • Introduction and installation of Visual studio (VS) • Writing, compiling, and executing C++ programs using VS 14 Steps for writing, compiling and running a C++ program 1. Create a project and project folder 2. Create a folder for storing programs (source code) 3. Add the source code to project 4. Compile and run the program 15 Create the project 16 1. Select File 2. Mouse over New 3. Click Project... Create a C++ Console Project 2: Select Empty Project 1: Choose C++ 3: click Next 17 Customize the project setting 3: click Create 18 2: Select the folder where you want the project saved e.g. c: \ Users \ <your log in name> \ Documents \ 1: type a Project name, e.g. tut1 Add a C++ program file into the project 1. Right click Source Files 2. Mouse over Add 3. Click New Item... 19 Add a C++ program file into the project 1: select C++ File(. cpp ) 3: click Add 2: enter a file name, e.g. tut1 20