LATEST VERSION: 9.0.6 - CHANGELOG
Pivotal GemFire® Native Client v9.0

Developing C++ Programs on Windows

Geode uses the Visual Studio 2010 Service Pack 1 compiler for C++ programs on Windows, which invokes Microsoft® cl.exe from the command line at compile time.

The Geode native client supports .NET 4.0 and Visual Studio 2010. For advantages and more information on the features of .NET 4.0 and Visual Studio 2010 SP1, see http://msdn.microsoft.com/en-us/library/dd831853(v=vs.100).aspx and http://msdn.microsoft.com/en-us/library/vstudio/w0x726c2(v=vs.100).aspx.

Visual Studio 2010 SP1 is the recommended compiler. If you are using any other compiler, contact technical support for assistance.

Note: When compiling external projects or applications that are used or referenced by the native client, make sure that you compile them for the same target architecture as your native client installation. For example, if you installed the 32-bit (x86) version of the native client, compile your external projects for 32-bit (x86) architecture.

Step 1. Installer Sets Up Environment Variables

When you install on Windows, the installer performs these tasks:

  • Sets the GFCPP environment variable to product-dir, where product-dir is the path to the native client product directory.
  • Adds the %GFCPP%\bin executable directory to the Windows PATH environment variable.

Step 2. Choose 32-bit or 64-bit Command-line Prompt

For 32-bit:

Start > Programs > Microsoft Visual Studio > 2010 > Visual Studio Tools > Visual Studio 2010 Command Prompt

For 64-bit:

Start > Programs > Microsoft Visual Studio 2010 > Visual Studio Tools > Visual Studio 2010 x64 Win64 Command Prompt

To build using the Microsoft Visual Studio Interface, from the Solutions Platform, choose Win32 or x86 from the Build menu for 32-bit builds or x64 for a 64-bit build.

The following table lists the compiler and linker switches that must be present on the cl.exe command line.

Note: If you want to use the Visual Studio user interface instead of invoking cl.exe from the command line, be sure to supply these parameters.

Argument Explanation
/MD Memory model.
/EHsc Catches C++ exceptions only and tells the compiler to assume that *extern* C functions never throw a C++ exception.
/GR Runtime type information.
-I%GFCPP%\include Specifies the Geode include directory.
%GFCPP%\lib\gfcppcache.lib Specifies the library file for the shared library.
/D_CRT_SECURE_NO_DEPRECATE Suppresses warnings. Required for Visual Studio 2010.
/D_CRT_NON_CONFORMING_SWPRINTFS Suppresses warnings. Required for Visual Studio 2010.

Step 4. Verify that You Can Load the Native Client Library

Because Geode does not provide a library that can be linked statically into an application on Windows, you must dynamically link to the native client library.

To make the native client library available for loading, verify that the directory product-dir/bin is included in the PATH environment variable, where product-dir is the path to the Geode product directory.