Installing the latest version of Boost C++ from source on Windows for use in Visual C++ in 5 simple steps

by APIJunkie 23. January 2012 06:38

If you wish to use the latest Boost C++ libraries in your Visual C++ projects and the automated Boost installers at: are not up to date, crashing (happened to me) or you just want to build them yourself,  you can follow a few simple steps to get the job done.

1. Download the latest version of Boost from:

The direct link for the current version (1.48.0) can be found at:

 2.  Extract the compressed file to a directory of your choice

Example: C:\SrcLibs\ boost_1_48_0

 3. Open a command prompt in the directory you created in step 2.

Example: C:\SrcLibs\ boost_1_48_0

 4. Type the following 2 commands at the command prompt:



 The above commands will configure and build the Boost libraries from source.

 It will take some time to build the libraries depending on your hardware.

 If all has gone well you should see a message along the lines of:

 The Boost C++ Libraries were successfully built!

 The following directory should be added to compiler include paths:

     C:\SrcLibs\ boost_1_48_0

 The following directory should be added to linker library paths:

     C:\SrcLibs\ boost_1_48_0\stage\lib

 5.  Add the Boost include and library path to a Visual C++ project

For example in Visual Studio 2010:

Create a new C++ console application

Go to Project/Properties/Configuration Properties/VC++ Directories/

Set Include Directories to:

C:\SrcLibs\ boost_1_48_0;$(IncludePath)

 Set Library Directories to:

C:\SrcLibs\ boost_1_48_0\stage\lib;$(LibraryPath)

That’s it; you can start writing code that uses Boost…





C++ | How To | Visual Studio | Boost

VS 2010 native code static linking

by APIJunkie 18. May 2011 06:36

This is a heads up for any one that is used to auto link static libraries using project dependencies.

VS 2010 changed the game by adding a new step that is necessary in order to auto link static libraries.

It is not enough to specify project dependencies as we used to do in older versions of Visual Studio.

To setup auto linking go to Project/Properties/Common Properties/Framework and References/Add new reference.


C | C++ | Static | Tips and Tricks | Troubleshoot | Visual Studio

How to develop native apps on VS 2010 targeting Win 2K and older Windows versions

by APIJunkie 24. March 2011 03:41

By default when developing native C/C++ apps using VS 2010 beware that your executables will not run on Win 2K and older targets.

That is true even if you remove any external dependencies and adhere to Win32 API compatible with older Windows versions.

One possible solution to the problem is Native Multi Targeting - using the VS 2008 compiler while working with the VS 2010 IDE. Assuming you can afford to have VS 2008 installed on the same machine.



C | C++ | How To | Tips and Tricks | Visual Studio

How to workaround Visual Studio 2010 Publish Web Site via FTP Bug

by APIJunkie 5. October 2010 08:03

After years of deploying web site files using custom FTP, Remote Desktop File Transfer etc. We decided to give VS 2010 Publish Web FTP a try.

It worked flawlessly the first couple of times until we started receiving errors on the staging/deployment server that were not reproducible on the development machines.

After doing some digging around, we found out that the web publish process was the culprit.

It turns out some files were not being replaced/updated when their versions changed on the development machines.

In our case they were web server controls sitting under one of the web site sub folders.

For some reason the web publish process did not detect changes even though earlier file versions were previously deployed correctly. It seems like there is a bug in the file change detection algorithm inside the FTP publish web process.

To solve the problem we had to force the publish web process to detect changes by deleting all the old files before deploying a new version.

To do this make sure you check the “Delete All Existing Files Prior to Publish” option in the Publish Web dialog/FTP publish options:

It makes deployment slower but at least you know you get the latest version of the files each time you publish.

Good luck!


ASP.NET | IIS | Web Development

Fix SQL Server 2008 Express Full Text Index Management Missing

by APIJunkie 12. July 2010 03:16

If you installed the SQL server 2008 express and you are missing the ability to manage full text indexes inside SQL server 2008 management studio. I.e. you are missing the storage folder inside management studio.

First make sure you installed SQL Server 2008 Express with Advanced Services (the version without advanced services does not support free text search functionality).

Second Try to Install SQL Server 2008 Express Edition Service Pack 1. Besides fixing some bugs it added the ability to manage full text indexes on my machine.

Hope this helps!


PRB | Tips and Tricks | SQL Server

Creating a Self-Signed Certificate for use with IIS on Windows Server 2003

by APIJunkie 25. June 2010 23:47

This is the second time I had to find the solution to install self assigned SSL certificates on IIS so I am writing this down for posterity.


In many cases it is desirable to create your own SSL certificate when working with IIS.

For example when developing/testing SSL secure web sites, when using a custom web application in a local intranet or for a closed  group of users to name a few.


It should have been easy to create your own SSL cert and instruct IIS to use it.

Microsoft delivered a tool to do just that. It was a part of the IIS 6.0 Resource Kit and it was called SelfSSL. But alas because of a bug in the SelfSSL tool you will run into problems if you try to use multiple certificates on a server.


Apparently Microsoft decided not to release a patch for the resource kit but instead released another tool that can be used to create self SSL certificates called SSL Diagnostics.


The tool is very easy to use. There is a nice tutorial on how to use the SSL Diagnostics tool to create an SSL certificate by Revindex.


Another option you might want to explore is using the open source alternative called OpenSSL. There is a nice tutorial on how to use OpenSSL with IIS by Dylan Beattie.


Best of luck!


How To | IIS | Tips and Tricks

Silverlight update KB982926 failure and solution

by APIJunkie 4. June 2010 23:29

I was doing the rounds and updating 2 machines, running XP Pro and 2003 Server, with Silverlight 3 run time pre installed on them. When the update was complete I couldn’t view any Silverlight based web sites with IE 8 on both machines.


I would only receive an install Silverlight message. It was as if Silverlight was not installed on the machines any more.


A quick check in the IE installed component list (Tools/Internet Options/Programs/Manage add-ons/Show all add-ons) showed me I was automatically upgraded to Silverlight 4 (Version 4.0.50524.0) which seems fine.


To solve the problem I did the following:


1. Went to


2. Pressed the install Silverlight button which crashed the installer (on npctrl.dll).


3. Restarted the browser at which point I got a message telling me I need to restart the browser again.


4. Restarted the browser for the second time which made Silverlight runtime and IE happy and willing to play together again.


KB | Silverlight | Troubleshoot

Using the free Babel Obfuscator in Silverlight projects

by APIJunkie 4. February 2010 05:24

One of the problems with Silverlight managed code is that it can easily be reverse engineered using standard .NET reflection tools.

Although no method can completely prevent reverse engineering your code there are ways to slow down and even deter all but the most persistent hackers.

Most of the tools I found that can be used to obfuscate Silverlight code are not free. But the Babel obfuscator by Alberto Ferrazzoli is an open source .NET obfuscator that can be used in Silverlight based projects.

Babel is a command line tool and it can be integrated into your build process. One way to do that is to add it to your post build events.

When you run babel on a target dll (assembly) it will generate an obfuscated version of the dll in the directory “.\BabelOut” relative to your dll output directory.

Usage Example:

"D:\Program Files \Babel\babel.exe" $(TargetPath) --noildasm --nomsil --noinvalidopcodes

Some caveats that apply to current babel version

1.       The current version does not support obfuscating xap files directly but you can unzip the files first or integrate the babel tool into your build process.


2.       Not all command line parameters/options are supported in Silverlight projects. The following options work:

       --noildasm --nomsil –noinvalidopcodes


3.       Some assemblies (dll’s) that contain resources do not seem to obfuscate correctly (Its very easily detected they are not usable after obfuscation). If you have this problem you can always move all the sensitive code into a separate Silverlight code library and obfuscate only the code library.


Let’s assume you have one monolithic project called: “MySilverlightApp” that contains all the code and resources (xaml, images etc.) that will not obfuscate. To solve the problem:

1.       Add a new project to the solution called “MySilverlightAppCode” of type “Silverlight Class Library”.

2.       Add a reference to the new Silverlight library from the “MySilverlightApp” project.

3.       Move all the sensitive code files into the new Silverlight code library (“MySilverlightAppCode”).

4.       Obfuscate only the “MySilverlightAppCode” assembly (MySilverlightAppCode.dll).



Silverlight | How To

Running multiple commands on a Visual Studio post-build event using batch files

by APIJunkie 31. January 2010 11:13

 Many times it’s more desirable to collect your post build commands into batch files. Some of the reasons include easier maintenance, portability and satisfying the “don’t repeat principle” when multiple projects are sharing the same commands. If you do decide to go down the batch road there are a couple of things you should be aware of:

1.       If you want to run multiple batch files or commands. You will need to use the “call” command to ensure that all the other commands execute. If you don’t do that only the first batch file will run. To use the call command, simply precede each batch file name with “call”.


Instead of writing:



call C:\MyBatchFile.bat


2.       Sometimes you will need to run external programs that could be installed in different locations on different dev machines. In such cases you might find the batch “start” command very useful. Instead of specifying the path, you just use the external program name or its file associations.


Let’s say you have several developers that have installed Winrar in different locations.

Writing: “C:\XXX\Winrar.exe” in the batch will not work in cases where developers installed it on another drive or location.

But writing: “start winrar” in the batch will work if it’s installed on the developer’s machine.

 Hope this helps!


.NET | Visual Studio | Portability

_mkdir C runtime library function might return unexpected error values

by APIJunkie 22. December 2009 08:05

mkdir is a C runtime library function that creates directories.

In contrary to what could be understood from the MSDN documentation:

“…On an error, the function returns –1 and sets errno as follows.EEXIST Directory was not created because dirname is the name of an existing file, directory, or device.ENOENT Path was not found.For more information about these and other return codes, see _doserrno, errno, _sys_errlist, and _sys_nerr.”

mkdir might return other error values. For example when calling mkdir on an existing directory the function might return EEXIST but can also return EACCES (permission denied). The function error results seem to differ according to user access permissions on the system. This has been tested on Windows 2003/Vista/7. For more information and portability issues check out this discussion about mkdir portability in Kernel trap.

·         Note that this discussion applies to Microsoft’s implementation of the C run time library.


C++ | C | Microsoft | Portability

About the author

Name of author

I was first wounded by x86 assembly, recovered and moved on to C. Following a long addiction to C++ and a short stint at rehab I decided to switch to a healthier addiction so I am now happily sniffing .NET and getting hooked on Silverlight.

I am mainly here to ramble about coding, various API’s, Junkies(me especially) and everything else that happens between coders and their significant other.

  James Bacon