1 / 20

CSCI N305 C Language Programming

CSCI N305 C Language Programming. Welcome to CSCI N305! Compiling Your First Program Using Microsoft Visual Studio 2008. Objectives for the Lab. Learn the difference between client-side and server-side programming Learn how to open an empty solution and project under Visual Studio .Net

enya
Download Presentation

CSCI N305 C Language Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSCI N305C Language Programming Welcome to CSCI N305! Compiling Your First Program Using Microsoft Visual Studio 2008

  2. Objectives for the Lab • Learn the difference between client-side and server-side programming • Learn how to open an empty solution and project under Visual Studio .Net • Compile and run a simple program

  3. Client-side vs Server-side compiling • Environment setup • Install MS VS .Net 2008 from iuware.iu.edu • Client-side compiling runs locally on your computer • Requires installation of a compiler on your system • Consumes local CPU and hard disk space • No network (internet) connectivity required • Service-side compiling runs remotely on a server • Requires remote access software such as SSH available from iuware.iu.edu • Server is typically more powerful CPU and has more storage. • Typically used for larger projects • Easier to implement team development environment • Normally uses a command line interface rather than graphical • Network (internet) connectivity required • Used for business applications that require production infrastructure (production monitoring, nightly backups, etc.)

  4. Start Microsoft Visual Studio 2008 • Start → All Programs → Microsoft Visual Studio 2008 → Microsoft Visual Studio 2008

  5. Starting for the first time • The first time you run MSVS, you might get a window like this. • Set Visual C++ Development Setting as your default environmental settings. • Use General Development Settings if you have no preference.

  6. Initial MSVS Window • Here is an image of the initial window.

  7. Opening a New Project • Open a project using File → New Project → Visual C++ → Win32 → Win32 Console Application → enter your project name and browse to select a location (where your project will be saved) → OK.

  8. Project Settings • Choose Next > at this dialog.

  9. Project Settings (continued) • Be sure to check Empty project and Finish.

  10. Add a New Item • Right-click on Source Files and Add a New Item.

  11. Create a .c File • Choose Visual C++ Code, C++ File, enter a file name with .c as the file extension.

  12. Enter Code into Your File • Enter a standard C program into the .c file.

  13. Save and Compile Your Program • Save → Build → Build Solution

  14. Save and Compile Your Program • A successful build:

  15. Save and Compile Your Program • An unsuccessful build, read the error message and correct the errors and build again:

  16. Run the Program • After a successful build, Debug →Start Without Debugging to run the program:

  17. Run the Program • Examine the output:

  18. Congratulations! • You created a new Microsoft Visual Studio 2008 Project. • Selected Visual C++ Win32 Console Application. • Created your own .c file, entering code just like in class. • Ran your program to produce output. • You did all of this using an easy editor without logging onto the internet.

  19. Open an Existing Program If your project is named projectOne: • Find the projectOne folder at the location where you saved your project. • In the projectOne folder, double click on the file projectOne.vcproj, or projectOne.sln. • Double click on the .c file (e.g. main.c) will only open up the code file. It will not let you compile or run the program using Visual Studio 2008.

  20. Submit a Program You only need to submit the .c file.

More Related