Visual Studio

Programming With Portability in Mind

Almost a year ago now I promised a series of articles on cross-platform C++.

Since then, I have finished porting a relatively large C++ project that I wrote to Linux, Solaris, and Windows. I've learned that C++ is really quite portable and there are just a few guidelines that you should keep in mind.

Use the Appropriate Compiler

Using Visual Studio Property Sheets to Manage Common Properties

Now that we have built Boost for Visual Studio, it sure would be handy to store the settings we need to use Boost in one place so that they can be easily set and reused.

Visual Studio property sheets allow us to do just this. A property sheet is a collected set of settings which are stored in a .vsprops file. The file can be stored and reused between projects when common properties are desired.

To create a property sheet for our Boost installation, we will first need to select the "Property Manager" tab of our project.

Building Boost With Visual Studio

Unfortunately, if you want to download a pre-compiled Boost for Visual Studio, you are required to register for an account with boostpro.com. When I was looking to download Boost for Windows recently 1.38 was not yet available precompiled and I personally did not want to register for an account to download free software, so I built it myself.

Fortunately, the process is very simple:

Building Visual Studio Express Projects From the Command Line

If you search around for how to build Visual Studio projects from the command line you will find references to the DevEnv executable. When working with Visual C++ Express, however, that tool does not exist.

An equivalent tool, vcbuild, does exist and can be used.

Start by opening the Visual Studio command prompt (Program Files->Microsoft Visual C++ 2008 Express Edition->Visual Studio Tools->Visual Studio 2008 Command Prompt).

Typing "vcbuild" gives you the command line help:

Syndicate content