Wednesday, June 30, 2010

Using MSBUILD and DEVENV to Clean

http://msdn.microsoft.com/en-us/library/5ak1w89s%28VS.80%29.aspx

devenv /clean Debug Solution.sln

One can also specify the project and project configuration.

Can also run the application after it is built.




Wednesday, June 23, 2010

Setting a Property in MSBUILD

Build a debug:

C:\>msbuild BuildAll.proj /property:Configuration="Debug"

Build a release:

C:\>msbuild BuildAll.proj /property:Configuration="Release"

Build for a given target:

C:\>msbuild BuildAll.proj /property:Configuration="Release" /t:TargetName

Tuesday, June 22, 2010

How to Set Properties Sheet in VS 2010

This took me a while to figure out.

First you need to be able to look at the property sheets.  They are ASCII files so you can look at them with an editor.  They have the file extension 'props'.

To access in VS 2010, select View ==> Property Manager option.

The property manager contains a list of projects.  Select the project you want to add a new or existing property sheet.  Right click on the project to see the options.  Adding are creating, puts the sheet in both debug and Release configurations.

Right click the property page and the property page will appear.  Select the User Macros property.  This displays a pane where you can add or remove macros.  The macro is added under both debug and release.




How to Ignore an Exception in C++

try
{
    // try something that might throw an exception here.
}
catch (...)
{
   // exception will be caught but ignored.
}

Monday, June 21, 2010

msvcprtd.lib(MSVCP100D.dll) : error LNK2005: already defined in gtestd.lib(gtest.obj)

This error occurs when the C/C++ Code Generation Runtime Library in gtest is defined differently from testing code using it.  The gtest project was defined as MTd (Multi-threaded Debug) and the testing project defined as MDd (Multi-threaded DLL).

Fix:  Changed the testing project to use MTd.  From the Property Pages select Configuration Properties ==> C/C++ ==> Code Generation ==> Runtime Library ==> Multi-threaded (/MT).

Tuesday, June 8, 2010

Keyboard and Mouse Sharing

Can be done with Synergy and Synergy+ in the open source area.  Can be done with done with Multiplicity and ZoneScreen if you want to buy the application.  Synergy will work across Linux and Windows.  Multiplicity and ZoneScreen only seem to work with Windows but is much more capable.  This is a nice site that shows the alternatives.