ISO C++ Project Template for Visual Studio 2013

Home Code CPTR 318


The ISO C++ project template file for Visual Studio 2013 that I use in class can be downloaded here: ISO-C++.zip.

Place the downloaded ISO-C++.zip file in the following folder (replace "rick" in the following path with your user name):

C:\Users\rick\Documents\Visual Studio 2013\Templates\ProjectTemplates

The next time you start Visual Studio and attempt to create a new C++ project you should have an option in the C++ projects dialog to create an ISO C++ console application. Give the project a relatively simple name because the template automatically will create a .cpp source file with the same name.

This custom project template does three things for you:

  1. It automatically generates a skeletal C++ file that contains the code common to all our C++ programs. You then need only fill in the details that are specific to the current program. This allows you to create a simple C++ program quickly without going through the error-prone steps of adding a Win32 Console application, remembering to make sure the project in empty, adding a new item (C++ source file), and typing in the #include<iostream>, using namespace std;, etc.
  2. It adjusts the compiler's warning level to 4. The Visual Studio IDE uses warning level 3 by default. The enhanced warning level allows the compiler to generate additional diagnostics about common programming mistakes. This is a good thing.
  3. It disallows Microsoft-specific C++ language extensions. Microsoft added enhancements to the C++ language to better support some of its technologies. Disabling these extensions allows the compiler to conform better to the ISO C++11 standard. This makes the code you write better able to run on other platforms like Mac OS X and Linux. We do not use any Microsoft-specific extensions in this course.

Even though this template automatically creates the source file containing the main function, you may add extra C++ source files to the project as needed through Visual Studio's normal Add item menu.

Note: If you are building graphical applications using OpenGL, GLUT, or my SGL library, you will need to enable Microsoft language extensions. You do not have to use the extensions in code that you write, but the libraries depend on them.