Installation Guide ~ Visual Studio C++ 2008 Express Edition [Note: This installation guide has been taken from http://cplus.about.com/od/learnc/ss/vc2008.htm] Online Installation [Recommended for those who have high speed internet connection] For online installation (directly installing from the internet) you just need to follow the steps as it is. There s no change at all. Offline Installation [Recommended for those who have slow speed internet connection] For offline installation (downloading the entire content once or installing it from the CD/DVD), the steps are the same. Just the steps in which Visual Studio C++ 2008 Express Edition is downloaded from the internet will automatically be skipped. For offline installation (downloading the entire setup once from the internet, go to the Visual Express Download Page and scroll down, till you find the Offline Installation. You may like to view the instructions for burning the Visual Studio Express Edition on DVD here. In any case make sure you follow the guide strictly. Happy Installation! 1
Before you Install You will need a PC running Windows 2000 Service Pack 4 or XP Service Pack 2, Windows Server 2003 with Service Pack 1, Windows 64 or Windows Vista. As this is a big download, ensure that you are up-todate with your Windows Updates first. You will also be required to register with Microsoft at the end of the process. If you have a Hotmail or Windows Live account already then use that. If not then you will need to sign up (it is free) for one. You'll need a reasonably fast Internet connection to the PC where you are going to install Visual C++ 2008 Express Edition. Dial-up will take too long for a download that's nearly 80MB without MDSN or over 300 MB with it. Starting the Download Go to the Visual Express Download Page and click on the Visual C++ Express logo. That will download vcsetup.exe. It's under 3 MB. Save it somewhere then run it. Keep this file if you want to reinstall. It will give you the option of submitting anonymously to help Microsoft improve the experience. I have no problems with this but it's your choice. 2
Download Visual C++ 2008 Express Edition You may get asked to install prerequisites if your PC doesn't have the.net 3.5 framework and MSDN, or 68Mb for just the C++ Part. You might want to do this early in the morning for faster download speed. It gets slower during the day. You won't need the Platform SDK now but you might find it useful in the future. You'll have to agree to the usual license terms of course. 3
Run and Register [Note: You can skip the MSDN installation if your internet connection is slower.] You'll get the option of installing the MSDN Express library. If you are also installing Visual C# 2008 Express, then you only need the MSDN Express library to be downloaded once. You will need the MSDN for the integrated help etc. Don't even think of not downloading at least one copy! There is an amazing amount of help, examples and samples in the MSDN library that make it well worth the big download. Now Click the Next button. 4
Preparing to Download You're almost ready to download and install. This is one of the slower bits particularly if you have selected MSDN and/or the SDK. You'll probably have time to prepare a meal never mind a coffee break! Check you have enough disk space free. As a general rule, Windows works best with at least 10-20% of the disk free and the occasional defragment. If you don't defrag now and then and if you delete and copy or create new files fairly frequently (such as this download) then files will be spread far and wide across your hard disk making it longer (and slower) to retrieve them. It's also reckoned to wear out disks quicker but that's difficult to quantify. Think of it as like a service for your car to keep it running well. Now click the Install button. 5
Watching the Download and Install This step will take a while depending on your internet connection speed and PC speed. But it will finish eventually and you will be able to play with Visual C++ 2008 Express. This would be a good time to register a hotmail account with Microsoft if you haven't got one. It's a bit of a pain if you haven't got one but at least it's free and doesn't take too long to sign up. You need this so you can login to it when you register at the end. It's free but without it; Visual C++ 2008 Express will only give you a 30 day trial. 6
Running Visual C++ 2008 Express Edition for the First Time After downloading and Installing, run Visual C++ 2008 Express Edition. This will try to connect to the internet to check for updates and new downloads. When you run it the first-time, it will take a few minutes registering components and configuring itself to run and you'll see the dialog appear while it's busy. You now have 30 days to register to get a registration key. The key will be emailed to you within a few minutes. Once you have it, run Visual C++ 2008 Express Edition, hit Help and Register Product then enter your registration code. 7
Compiling a Sample Application "Hello World" Do a File New Project it should look like the screen above then on the New Project Screen (Shown on the next page) select Win32 and Win32 Console Application on the right hand Window. Enter a name like ex1 in the Name: box. Choose a location or go with the default and press Ok. 8
Type in the Hello World Application Select General and Empty Project. Enter the name of the Project as Hello World. Right click on project name and select Add New Item Select C++ Source File (.cpp) and name it as Program.cpp (it can be any name). Type in the following program. // Program.cpp : Defines the entry point for the console application. // #include <iostream> using namespace std; int main() { cout << "Hello World\n"; return 0; } 9
Compile and run the Hello World Application Now press the F7 key to compile it or click on the Build Menu and click Build. That will take a few seconds and you should see ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ========== If there are any failures, view the lines, correct them - it's most likely a mistyped character and recompile again. After a successful compilation, click on the line that says return 0 and press the F9 key. It should put a small circular arrow in the margin. That's a breakpoint. Now press F5 and the program should run until it hits the line where you pressed F9. You should be able to click the black box where the output of the application goes and see the Hello World message in the top left corner. On the next page you'll see a screen dump of this. Now select Visual C++ again, and press F5 again. The program will run to completion and the output window will vanish. If we hadn't created a break point you wouldn't have seen the output. That completes the installation. Now why not have a look at the C and C++ Tutorials. Link to C++ Programming Tutorials. Link to C Programming Tutorials. 10