Building ACE on Windows using Visual Studio

The Adaptive Communication Environment (ACE)  framework is an extensive set of cross-platform tools in C++. In this post I will describe in detail the steps required to set up the ACE framework on Windows using Visual Studio, and to set up a project using the ACE framework. The process is not complicated, but there are several pitfalls that one should be aware of.

Here we go!

Note: Steps 1-6 are partially covered in the ACE Build Guide. I give them here with some extra hints and tips.

  1. Download the ACE framework from here. We will be using the full version of (last line under “Latest Micro Release Kit”).
  2. Unzip this file into the directory where you want your ACE files to be located. I put my ACE files under C:\Programming\C++. Unzipping the file creates an ACE_Wrappers directory (C:\Programming\C++\ACE_Wrappers in my case). We’ll call this directory the ACE_ROOT directory.
  3. Go to the ACE_ROOT\ace directory (C:\Programming\C++\ACE_Wrappers\ace in my case) and create a file called “config.h”. Edit this file with notepad or any other text editor and put the following text in the file:
    #include “ace/config-win32.h”
  4. In the ACE_ROOT directory there are several solutions for different versions of Visual Studio and for different types of libraries. In this tutorial I will be using Visual C++ 2008 Express Edition (which is also called vc9) and building ACE as a static library. So the solution I  need is ‘ACE_wrappers_vc_9_Static.sln’. Select the solution that fits your needs.
    * Note: Visual Studio 2010 users can use the vc9 solutions. The Conversion Wizard will upgrade the solution to VS 2010 format.
  5. Select your configuration (Debug or Release) and build the ACE project in your solution. In my case this is ‘ACE_vc9_Static’.
    Building the ACE library
  6. After a few minutes of building, you should have the ACE library file in your ACE_ROOT\lib directory. I built using the Debug configuration, so the file that was created is c:\Programming\C++\ACE_Wrappers\lib\ACEsd.lib
  7. We are now ready to create our first ACE project! Create an empty C++ solution and then edit the project properties.
  8. In “Properties”–“C/C++”–“General”–“Additional Include Directories” add the ACE_ROOT directory.
    Additional Include Directories

  9. In “Properties”–“C/C++”–“Preprocessor”–“Preprocessor Definitions” set the following:

    Preprocessor Definitions

  10. In “Properties”–“C/C++”–“Code Generation”–“Runtime Library” set to Multi-Threaded debug (/MTd) for the Debug configuration and Multi-Threaded (/MT) for the Release configuration.
    Code Generation
  11. In “Properties”–“Linker”–“General”–“Additional Library Directories” add the ACE_ROOT\lib directory.
    Additional Library Directories
  12. In “Properties”–“Linker”–“Input”–“Additional Dependencies” add ACEsd.lib for the Debug configuration and ACEs.lib for the Release configuration.
    Linker Input
  13. Your project is now configured to work with ACE. You can create your project code and start using the ACE framework. Following is a simple example program that runs a thread to perform some work.
    ACE Test Program

That’s all folks!

This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Building ACE on Windows using Visual Studio

  1. Avishay says:

    Thanks Man ! :)

  2. MBG says:

    Really Big Thanks for you Man

  3. kthinh says:

    Thanks so much! It’s so useful…

Leave a Reply

Your email address will not be published. Required fields are marked *