The 25 days of C++mas - December 6 - get a C++Builder 64-bit Boost!

By: David Intersimone

Abstract: David I discusses Boost Libraries support in C++Builder 64-bit

This is a copy of a blog post from David I's Sip from the Firehose blog. Click to blog post title below to see the original blog post and comments.

  The 25 days of C++mas - December 6 - get a C++Builder 64-bit Boost!

As I mentioned in my Happy C++mas December 1st blog, we are including two versions of the Boost libraries for C++Builder XE3 in the upcoming 64-bit compiler release, Boost version 1.50.0 (for 64-bit target platforms) and Boost version 1.39 (for 32-bit target platforms).  Our goal is to unify our 32-bit and 64-bit compilers and libraries in the future, but for now we will live in a hybrid world.  The Boost C++ Community recently announced the release Boost libraries 1.52.0 (you should also read the special note about this release and future releases).  When we build products that include external moving parts, we have to choose a version to include in our release and cannot always synchronize everything at the same time.  With our C++11 compatible 64-bit compiler, it should be much easier to provide updated standard and Boost libraries in the future.

The Boost libraries are a set of C++ libraries that significantly expand the language using template metaprogramming. For a 64-bit Windows install, you get both Boost 1.50.0 (for 64-bit Windows applications) and Boost 1.39 (for 32-bit Windows applications). In addition, for Boost Version 1.39, separate libraries are installed for 32-bit Windows and for OS X. Binaries are built for functions that require them. Include paths are set for the Boost libraries, and any necessary libraries should be automatically linked because of #pragma link lines in the Boost code.  You can use the Boost C++ libraries in your VCL and FireMonkey applications.

Boost Libraries

The following table shows the Boost Libraries Versions that are used on specific target platforms and installed on specific development systems with RAD Studio XE3 and C++Builder XE3:

    Boost Version Target Platform Development System
    Boost version 1.39 32-bit Windows target platform 32-bit Windows and 64-bit Windows
    Boost version 1.50.0 64-bit Windows target platform 64-bit Windows

Boost Version 1.39 Installation Information

  • For Boost Version 1.39, on a 32-bit Windows system, the typical include directory is: C:\Program Files\Embarcadero\RAD Studio\<n.n>\include\boost_1_39\boost
  • For Boost Version 1.39, on a 64-bit Windows system, the typical include directory is: C:\Program Files (x86)\Embarcadero\RAD Studio\<n.n>\include\boost_1_39\boost
  • For Boost Version 1.39 on a 32-bit Windows system, the libraries are typically installed here: C:\Program Files\Embarcadero\RAD Studio\<n.n>\lib\win32\release
  • On a 64-bit Windows system, the Boost Version 1.39 Win32 libraries are installed here: C:\Program Files (x86)\Embarcadero\RAD Studio\<n.n>\lib\win32\release
Boost Version 1.50.0 Installation Information
  • For Boost Version 1.50.0, the typical include directory is: C:\Program Files (x86)\Embarcadero\RAD Studio\<n.n>\include\boost_1_50\boost
  • For Version 1.50.0, the installed files are typically here: C:\Program Files (x86)\Embarcadero\RAD Studio\<n.n>\lib\win64\release

Where <n.n> = the RAD Studio or C++Builder release number.  For XE3 this is 10.0.

Including the Boost Libraries for Windows

A C++ application uses the correct version of Boost to match the target platform for an application. For example, if your application has a 64-bit Windows target platform, Boost version 1.50.0 is used. If you set a 32-bit Windows target platform, Boost version 1.39 is used.
In a Boost 1.39  and 1.50.0 installation, the Boost minmax extensions are installed in the algorithm directory. For example, to use minmax in an application that targets 32-bit Windows/OSX and 64-bit Windows, your code should specify:

    #include <boost/algorithm/minmax.hpp>

This command includes the minmax library that is part of the algorithm directory. The path to the Boost libraries is specified in the following IDE environment variables:

  • CG_BOOST_ROOT for 32-bit Windows systems
  • CG_64_BOOST_ROOT for 64-bit Windows systems

These variables are set using the Tools > Options > Environment Options > Environment Variables dialog box in the IDE.
Including the Boost Libraries for Mac OS X Applications

For Mac OS X application development, you can use the Boost libraries for OS X, which are installed by default in the program files on the development computer at:

  • For Boost Version 1.39 on a 32-bit Windows system, the OSX libraries are typically installed here: C:\Program Files\Embarcadero\RAD Studio\<n.n>\lib\osx32\release
  • On a 64-bit Windows system, the Boost Version 1.39 OSX libraries are installed here: C:\Program Files (x86)\Embarcadero\RAD Studio\<n.n>\lib\osx32\release

Using the same #include statement shown in the minmax example above also includes the Boost Libraries for Mac OS X in your project.

CodeRage 7 C++ Conference, December 10-12, 2012

The CodeRage 7 C++ conference starts next Monday, December 10, 2012 at 6am Pacific Standard Time (14:00 UTC).  There are 3 days of C++ sessions including my special live, online conversation with Bjarne Stroustrup at 8am PST (16:00 UTC) on Monday.  Some of the C++ sessions you won’t want to miss are included in my blog post on November 21 - http://blogs.embarcadero.com/davidi/2012/11/21/41993.

Happy C++mas!

During the first 25 days of December leading up to Christmas, I will blog about the upcoming release of the C++Builder 64-bit compiler for Microsoft Windows and C++Builder XE3support for building VCL and FireMonkey 2 applications.

Server Response from: ETNASC01