Project 7: Compiling C on Windows 7 (15 pts.)

What You Need

Purpose

You will write a small C program and compile it.

Downloading and Installing Visual Studio Express Installer File

The Visual Studio file is 4.7 GB. If you can't download it at home, use the hacking lab.

In a Web browser, go to http://www.visualstudio.com/downloads/download-visual-studio-vs

On the left side, expand the "Visual Studio 2013 section. Click "Express 2013 for Windows".

A file named winexpress_full.exe downloads. Navigate to that file in File Explorer, right-click it, and click "Run as Administrator".

If warning boxes pop up, approve running the software.

A "Visual Studio" box opens, as shown below.

Check the "I agree" box.

At the bottom of the box, click Install.

Wait while software downloads and installs. It will take a long time, perhaps an hour.

Install the software with the default options.

When I did it, I got a message saying "Microsoft SQL Server 2012 Express LocalDB Package failed." It's OK to just ignore that--we don't need SQL Server.

Restart your machine when you are prompted to.

Launching Visual Studio Express

Click Start. Click "VS Express 2013 for Desktop".

A box appears, asking you to "Sign in". Click "Not now, maybe later".

If a box pops up saying "Enable Developer Mode for Windows 10", click OK.

Visual Studio Express launches, as shown below:

Creating a Simple C Program

From the "Visual Studio Express 2013" menu, click FILE, "New Project...".

In the "New Project" window, on the left, expand the "Visual C++" container.

Click Win32.

In the center pane, accept the default selection of "Win32 Console Application", as shown below.

At the bottom of the "New Project" window, type a Name of YOURNAME-1, replacing "YOURNAME" with your own name. Do not use any spaces in the name.

In the "Location" line, notice the location files will be saved in--it's a subfolder of your Documents folder.

In the "New Project" window, click OK.

A box opens, titled "Welcome to the Win32 Application Wizard".

Click Next. In the next screen, accept the default settings and click Finish.

A window opens, showing a simple C program.

Add this line to the program, as shown below.

Do not use the literal string "YOURNAME"--replace it with your own name.

printf("Hello from YOURNAME!\n");

Compiling your Program

Click BUILD, "Build Solution".

You should see the message "Build: 1 succeeded" at the bottom of the window, as shown below.

Running your Program

Click DEBUG, "Start Without Debugging".

A Command Prompt window opens, showing the message with your name in it, as shown below:

Saving the Screen Image

Make sure you can see the windows showing "Hello from YOURNAME!", as shown above.

On your keyboard, press the PrntScrn key.

Click Start, type in PAINT, and open Paint.

Press Ctrl+V to paste in the image of your desktop.

YOU MUST SUBMIT WHOLE-DESKTOP IMAGES TO GET FULL CREDIT.

Save the image with a filename of "Proj 7 from YOUR NAME".

Turning in Your Project

Email the image to: cnit.126sam@gmail.com with a subject line of Proj 7 From Your Name, replacing Your Name with your own first and last name. Send a Cc to yourself.

References

Creating a Win32 Console Application

Last Modified: 3-7-16