Monday, August 03, 2009

Compiling CrypSafe

Back from the sunny Algarve and ready for more work. I have to confess that during these last two weeks I barely touched my laptop, but I surely needed the rest.

Compiling the CrypSafe prototype has proven to be a bit of a challenge for some of the readers and I have received some complaints about this very subject. Here is a list of what you need to do, both with VS 2005 and VS 2008 to get the sample to compile. Please note that I'm distributing the VS 2008 solution files only but you should be able to recreate the project for VS 2005 without major issues.

Here's what you must do to compile the sample:
  1. Download WTL 8.0 or 8.1. You can get the latest version of WTL from its sourceforge page.
  2. Unzip the WTL distribution file to a directory of your choice.
  3. Under the installation directory, you will find some directories named AppWiz, AppWizCE and AppWizMobile. Navigate to each of these in turn and run the setup90.js (for Visual Studio 2008) and/or setup80.js (for Visual Studio 2005) scripts in order to install the Visual Studio application wizards. Please note that under Vista (and probably also under Windows 7) you must open a command prompt with elevated privileges because these scripts write files to the Visual Studio install directories.
  4. Now you have to open Visual Studio and let it know where to find the WTL include files. To do this, open Visual Studio and go to the Tools / Options menu and select "Projects and Solutions" item in the tree. Select the "VC++ Directories" under that item and then select the "Include files" option of the "Show directories for:" combo box. Now, for each platform listed on the left combo box, you must enter your WTL include directory in the list below.
  5. Now you can open the CrypSafe solution in Visual Studio and try to compile it. If it still fails, please make sure you correct each project's "Additional Include Directories" property under the project's Configuration Properties / C++ / General option.
If you still find errors while compiling, please let me know through a comment to this post.

3 comments:

smartmobili said...

You also need to change full path to relative path for each projects:

Project Properties->C/C++->General->Additional Include Directories:

*CrypSafe :
Change
D:\src\VS2008\cpp\wmtypes;D:\src\VS2008\cpp\OleDbClient;D:\src\VS2008\cpp\wmfw

into
..\wmtypes;..\wmfw

*wmfw :
Change
D:\src\VS2008\cpp\wmtypes
into
..\wmtypes

João Paulo Figueira said...

Absolutely right! This will be changed in the next version. Thanks!

RanchHand said...

When I compiled CrypSafe, I found I needed to obtain OleDbClient from one of your previous blog posts. After that, it worked fine.