CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2003

Similar documents
CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2005

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2010

TREX Set-Up Guide: Creating a TREX Executable File for Windows

WRITING CONSOLE APPLICATIONS IN C

Opening Microsoft Visual Studio. On Microsoft Windows Vista and XP to open the visual studio do the following:

Visual C++ Tutorial. For Introduction to Programming with C++ By Y. Daniel Liang

Using OpenGL & GLUT in Visual Studio.NET 2003

Introduction. Key features and lab exercises to familiarize new users to the Visual environment

IMPLEMENTING SCL PROGRAMS. Using Codeblocks

Creating a MOM 2005 Peformance Graph Report From a Template

Lab 1: Introduction to C Programming. (Creating a program using the Microsoft developer Studio, Compiling and Linking)

How to debug Wcem.dll with.net Studio

Engr 123 Spring 2018 Notes on Visual Studio

Module 3: Working with C/C++

CPE 323: Laboratory Assignment #1 Getting Started with the MSP430 IAR Embedded Workbench

Building AMD64 Applications with the Microsoft Platform SDK. Developer Application Note

BASIC USER TRAINING PROGRAM Module 4: Topology

Configuring Visual Studio 2017 with SFML Game Engine

DEVELOPING OOSIML SIMULATION MODELS. Using Codeblocks

Getting Started with Visual Studio

Compiling MapleSim C-Code in Visual C Express

APPENDIX A. CODE COMPOSER STUDIO (CCS) v5: A BRIEF TUTORIAL FOR THE DSK6713

OOSIML SIMULATION MODELS. On Windows and Linux

Creating Mixed Language Projects with Microsoft Developer Studio 2005, Intel Fortran, MS C++ and Canaima Legacy Software

Applied ICT Skills MS Windows

EM L13 Preparing Applications to Virtualized and Streamed Hands-On Lab

As CCS starts up, a splash screen similar to one shown below will appear.

CSCI 161: Introduction to Programming I Lab 1b: Hello, World (Eclipse, Java)

USING CODEBLOCKS. Implementing Computational Models

ECE 103 In-Class Exercise L1 Guide

Tutorial 2 - Welcome Application Introducing, the Visual Studio.NET IDE

Developing Applications using Universal Driver 6.0x in Windows CE 6.0

For additional information, please consult the Read-Me and Help documentation or contact Electro-Voice or Dynacord technical support.

Code Composer Studio Operation Manual

Installing Eclipse CDT and MinGW

EECE.2160: ECE Application Programming Spring 2018 Programming Assignment #1: A Simple C Program Due Monday, 1/29/18, 11:59:59 PM

HOW TO USE CODE::BLOCKS IDE FOR COMPUTER PROGRAMMING LABORATORY SESSIONS

As CCS starts up, a splash screen similar to one shown below will appear.

CaliberRM 5.1 Integration for Describe Enterprise

Navigating a Database Efficiently

Exercise 7-1 Preparing Files for Distribution

5.5.3 Lab: Managing Administrative Settings and Snap-ins in Windows XP

Ticket Mail Merge Instructions for MS Word 2007 and 2010

Click on the Start Icon. Click on All Programs

DOMAIN TECHNOLOGIES. Getting Started Guide Version 1.1. BoxView IDE. Integrated Development Environment

Migration from HEW to e 2 studio Development Tools > IDEs

Sabre Customer Virtual Private Network Launcher (SCVPNLauncher)

Test/Debug Guide. Reference Pages. Test/Debug Guide. Site Map Index

General Guidelines: SAS Analyst

EDEM Dynamics Coupling Quick Start Guide

JUCE TUTORIALS. INTRO methodology how to create a GUI APP and how to create a Plugin.

Check the Desktop development with C++ in the install options. You may want to take 15 minutes to try the Hello World C++ tutorial:

IT Essentials v6.0 Windows 10 Software Labs

Developing Intelligent Apps

CodeWarrior Development Studio for Advanced Packet Processing FAQ Guide

dotdefender for IIS Installation Guide

TOP SERVER V5 CLIENT CONNECTIVITY ROCKWELL FACTORYTALK VIEW STUDIO. Table of Contents

Netherworks Studios. Start DAZ Studio 3 and simply navigate to "NWS Scripts" in your content folder. Run the "Activate Folder Favorites" script.

Lab - Create a Partition in Windows 8

Evaluation Guide - WebSphere Integration

Windows NT Server Printer Driver Upgrade Instructions

Welcome Application. Introduction to C++ Programming (Solutions) 2004 by Deitel & Associates, Inc. All Rights Reserved.

Using the Dev C++ Compiler to Create a Program

Project. A project file contains the following information:

Use Vivado to build an Embedded System

Lab 4: Introduction to Programming

You have a PC with a USB interface, running Microsoft Windows XP (SP2 or greater) or Vista You have the Workshop Installation Software Flash Drive

QUICKSTART CODE COMPOSER STUDIO Stellaris Development and Evaluation Kits for Code Composer Studio

Parallel Printers Set-Up

Session 10 MS Word. Mail Merge

Using Eclipse for Java. Using Eclipse for Java 1 / 1

Dealing with Event Viewer

RVDS 4.0 Introductory Tutorial

User Guide. Introduction. Requirements. Installing and Configuring. C Interface for NI myrio

Hello World on the ATLYS Board. Building the Hardware

Pursuit 7 for Windows

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

Tools Basics. Getting Started with Renesas Development Tools R8C/3LX Family

MS Visual Studio.Net 2008 Tutorial

Carleton University Department of Systems and Computer Engineering SYSC Foundations of Imperative Programming - Winter 2012

APPLICATION COMMON OPERATING ENVIRONMENT (APPCOE)

Content Management Application (CMA)

SITE DESIGN & ADVANCED WEB PART FEATURES...

Tutorial : creating a Max/MSP external project for Windows using Visual Studio

Experiment 6 Finite Impulse Response Digital Filter (FIR).

UAccess ANALYTICS Next Steps: Creating Report Selectors

Using Eclipse for C, MPI, and Suzaku

Where Did My Files Go? How to find your files using Windows 10

ProSystem fx Portal User Guide

ECE4703 Real-Time DSP Orientation Lab

Overview. Experiment Specifications. This tutorial will enable you to

CCH Axcess Portal Client User Guide

HPC on Windows. Visual Studio 2010 and ISV Software

Newforma Contact Directory Quick Reference Guide

SQL Server 2005: Reporting Services

Cupid Documentation. Release 0.2 (ESMF v7) Rocky Dunlap

Creating a new CDC policy using the Database Administration Console

Using Code Composer Studio IDE with MSP432

Exchange Address Book Order

Appendix M: Introduction to Microsoft Visual C Express Edition

Transcription:

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2003 The process of creating a project with Microsoft Visual Studio 2003.Net is to some extend similar to the process in Visual Studio 6.0, but Microsoft added a few more layers and changed the user interface. The latest incarnation of Visual Studio made the project properties configuration clearer and more convenient. The experience now resembles the one you have had or will have with other Integrated Development Environments (IDEs). To create a C Language Console Project, you should follow the steps outlined below. 1. Getting Started Launch Microsoft Visual Studio.Net 2003. After the flash screen disappears you should be presented with the Microsoft Development Environment [design] window. Depending on the installation configuration the window can contain different views. By default it should display the Start Page view. If the Start Page is missing, you can invoke it from the main menu bar opt for Help, Show Start Page. The screen could look a bit different from the one shown in Figure 1 if you have already created some projects they will be listed in the Projects tab list. You can also see some other views displayed. Figure 1. Microsoft Development Environment Start Page view displayed. In our labs the Microsoft Development Environment should start as shown in Figure.1a below. CST8152 Compilers Page 1 of 9

Figure 1a Microsoft Development Environment Start Page is not displayed. 2. Creating a project - Selecting a Project Type Click on the New Projects button in the Start Page view (Fig. 1) or opt for File, New, Project from the main menu bar. In both cases the New Project window should appear as shown in Figure 2. Select Visual C++ Projects in the left pane (Project Types) and Win32 Console Project in the right pane (Templates). Enter the name of the project in the Name text filed, for example, cdtypes. Choose the location of the project, for example, C:\Compiler\Lab0 or better N:\Compiler\Lab0. Click OK. The Win32 Application Wizard should appear as shown in Figure 3. Figure 2. Selecting the Project Type and Naming the Project. CST8152 Compilers Page 2 of 9

3. Creating a project - Selecting an Application Type In the Win32 Application Wizard click the Application Settings tab on the left. Make sure Console application is selected as an Application type. Check Empty project under Additional options as shown in Figure 3. Click Finish. The Solution Explorer view should appear. If not, choose View, Solution Explorer from the main menu. Figure 3. Selecting Console Application. In the Solution Explorer view window you should see your project node tree. It contains four folders: References, Source Files, Header Files, and Resource Files as shown in Figure 4.If you try to open some of the folders, you will find that they are empty. You can remove the Resource Files node. Select Resource Files, right-click, select Remove and confirm with OK. Figure 4. An Empty Project CST8152 Compilers Page 3 of 9

If you do not like the name of the project, you can change it. Simply select Solution, right-click, select Rename and type the new name of the project. Then, select the cdtypes project node, right-click, select Rename and type the new name. 4. Setting the Project Properties Before setting the project properties a C/C++ file must be added first. Otherwise C/C++ folder option will not be visible in the right pane in Figure 5. Section 5 explains in details how to add a new or existing file. To add a new file you should right click on the project name cdtypes (or the Source folder) and select Add, Add New Item. Select Code in the right pane, and C++ File in the left pane. Type the name of the file in the Name: text field. The file extension must be.c. Click the Open button at the bottom. The next step is to set the project properties. Select Project, Properties from the main menu (or right-click on cdtypes and select Properties. The Property Pages window should appear as shown in Figure 5. On the left side you will see the Configuration Properties tree. A thick arrow points to the currently selected property. On the right side you can see the default settings. When the window opens the General property is selected by default (see Figure 5.). Clicking on the folder icons you can choose and configure different setting of your project. Figure 5. The Property Pages Window. To change a configuration parameter (or property) you must select the corresponding line, click on the pull-down list icon to reveal the list of allowed options, and select the appropriate one as shown in Figure 6. Figure 6 show how to change the Character Set property to Not Set. Once you are done with the page, you should click Apply and move to the next page. CST8152 Compilers Page 4 of 9

Figure 6. Configuration Properties, General changing a property. 4.1. Changing the C/C++ Project Properties (settings) Click on the C/C++ folder. The C/C++ property nodes will appear as shown in Figure 7. The General property page is selected by default. In Figure 7 the default Warning Level property - Level 3 (/W3) is changed to Level 4. No changes are required in Optimization, Preprocessor, Code Generation, Precompiled Headers, Output Files, and Browse Information. You can peruse the property pages for further reference. Figure 7. C/C++ Property Pages Warning level changed in General CST8152 Compilers Page 5 of 9

Go to Language, select Disable Language Extension and select Yes(/Za) as shown in Figure 8. This will force the compiler to be ANSI C compliant. Figure 8. Making the compiler ANSI compliant. Move to the Advanced page. Change Compile As from Compile as C++ Code (/TP) to Compile as C Code (/TC) as shown in Figure 9. Figure 9. Forcing the C++ compiler to work as a C language compiler. CST8152 Compilers Page 6 of 9

4.2. Changing the Linker Project Properties No any changes are required for the Linker Properties. In Linker, General you can change the name of the executable file which will be generated by the linker. Note: I f you want to change the name of the project (output exe file) you must change in Linker, General the Output File option to <inherit from project defaults> or select <Edit > and change the name manually. 4.3. Changing the Other Project Properties You can explore the rest of the property pages, but there is no need to change any of the default setting for this particular project. So click Apply and OK to finish with the project properties configuration. Select File, Save All to save the project settings. 5. Adding Source Code to your Solution (Project) To add a C program to your project, select Source Files, right-click, select Add. Now you have the option to add a new program file or an existing program file as shown in Figure 10. If you program or header file dos not exist, you can add a new item to your project. Select Add New Item and in the Add New Item window select Code folder icon on the left, select the C++ File or Header File on the right, type the name of your source file in the Name text filed as shown in Figure 12. Click Open and the file will be added to your project (Figure 11) and an empty program editor will appear on the screen. You can type your program now. If you program has been already written, before performing the add operation, you should copy the file into the project directory. After selecting Add Existing Item the Add Existing Item window will appear and you can select the c-file from the list. Click Open and the file will be added as a subnode to your Source Files folder as shown in Figure 11. Now you can start working with your program. Double click on the name and the program will be opened in the program editor. Or right-click and select Open. Figure 10. Adding a Source Code Item Figure 11. A Program is Added to the Project. CST8152 Compilers Page 7 of 9

Figure 12. Adding a New Source File. 5. Compiling a C program In Solution Explorer select the C file you want to be compiled, right-click and select Compile. The result of the compilation will be shown in the Output view. The Compile action creates an object file only, not an executable. Pay attention to the warnings. 6. Building a Project To build a project means to make a request to the IDE to compile all your project files (c and h) and to link the compilation results (the obj file) into an executable. To build a project, select the project node (for example, cdtypes) in Solution Explorer view, right-click, and select Build. The results from the building process will be reported in the Output view. If the operation of building the project is successful, an executable file will be created in your project Debug directory. Pay attention to the warnings. 7. Running the Program You can run your program within the IDE, or as a stand alone program from the command prompt in a Command Prompt (DOS or console) window. To run the program within the IDE, select Debug, Start Without Debugging (Ctrl+F5). The result of the execution will be shown in an application window. To run the program from the command prompt you need to open a Command Prompt window. To open a Command Prompt window, select Start, Run, type cmd or command, and click OK. Once you have the command prompt window opened, use the cd command to navigate to your project Debug directory, type the name of your executable (for example, cdtypes) and press Enter. CST8152 Compilers Page 8 of 9

Now it is time to close the Net and count the fish. Enjoy it. S^R, 2008 CST8152 Compilers Page 9 of 9