Configure Visual Studio 10.0 Projects to Build Clients

To build StreamBase C++ clients for Windows using Visual C++ 10.0 (Visual Studio 2010), configure your Visual C++ projects as described on this page.

Alternate Project Types

  • To build C++ functions for 32-bit Windows, you must use Visual C++ 7.1 and must configure your projects as described in Configure VC 7.1 for Functions.

  • To build C++ functions for 64-bit Windows, you must use Visual C++ 8.0 and must configure your projects as described in Configure VC 8.0 for Functions.

Configuring Visual C++ 10.0 projects to build StreamBase clients is much simpler than for other Visual C++ versions. Visual C++ 2010 and future versions allow you to specify a set of library files to be automatically linked into your client module. This avoids having to explicitly list DLLs in the project settings.

The library-loading pragmas are called from the header file <streambase/Client.hpp>, which should be the first StreamBase-related header file #included in your client code files.

Configuring for New Projects

Follow these steps to configure a new Visual C++ 2010 project to build StreamBase clients:

  1. In your project settings for All Configurations and All Platforms, add two entries:

    Configuration Properties Folder Property Page Property Row Setting
    C/C++ General Additional Include Directories Add streambase-install-dir\include, using the full path to your StreamBase installation directory.
    Linker General Additional Library Directories Add streambase-install-dir\lib\$(Platform)\$(PlatformToolset), using the full path to your StreamBase installation directory.

    When expressing the path to your StreamBase installation directory, do not use ${STREAMBASE_HOME} unless you have explicitly made a global setting for the STREAMBASE_HOME environment variable. In the default StreamBase installation, this variable is not set globally.

  2. Specify #include <streambase/Client.hpp> as the first StreamBase-related line of your source files.

When used together, these two steps do all the work of configuring to build StreamBase clients. The Visual Studio macro $(Platform) resolves to either Win32 or x64, while the macro $(PlatformToolset) resolves to V100 for Visual C++ 1.0.

Upgrading Existing Projects

Follow these steps to upgrade an existing StreamBase client project to use Visual Studio 2010:

  1. If your project files are managed by a version control system, add the new project file format with extension .vcxproj.

  2. In your project settings for All Configurations and All Platforms, adjust two entries:

    Configuration Properties Folder Property Page Property Row Setting
    C/C++ General Additional Include Directories Replace streambase-install-dir\lib(64)\Debug and ...\lib(64)Release with streambase-install-dir\include, using the full path to your StreamBase installation directory.
    Linker General Additional Library Directories Replace streambase-install-dir\lib\$(ConfigurationName) with streambase-install-dir\lib\$(Platform)\$(PlatformToolset), using the full path to your StreamBase installation directory.
    Linker Input Additional Dependencies

    Remove the following entries:

    LibsbClient-vc#.lib
    LibsbUtil-vc#.lib
    pthreads-vc#.lib
    xercesLib-vc#.lib
    WS2_32.lib
    Dbghelp.lib

    When expressing the path to your StreamBase installation directory, do not use $(STREAMBASE_HOME) unless you have explicitly made a global setting for the STREAMBASE_HOME environment variable. In the standard, default StreamBase installation, this variable is not set globally.

  3. In your StreamBase client source files, replace all instances of:

    #include "StreamBaseClient.hpp"

    with:

    #include <streambase/Client.hpp>

Client Program Redistribution

To distribute your StreamBase client program to a machine that does not have StreamBase installed, you must also include the following:

  • The pthreads-v100.dll file from streambase-install-dir\bin for a 32-bit environment, or from streambase-install-dir\bin64 for a 64-bit environment. Install this file in the same directory as your client program's executable.

  • The Microsoft Visual C++ 2010 runtime. See Microsoft documentation for a discussion of the ways you redistribute the runtime. In general, you can:

    • Copy the runtime DLLs to the same directory as your client program. The DLLs are MSVCP100.DLL and MSVCR100.DLL, and can be copied from:

      C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\redist\
      

      At that location, look for either x86 or x64 directories, under each of which, look for Microsft.VC100.CRT, which contains the two DLLs of interest. If your client program uses MFC or OpenMP, you must copy more DLLs from that directory.

    • If you create a standard MSI installer for your client program, you can incorporate the merge modules provided with Visual Studio 2010. The files to incorporate are:

      Microsoft_VC100_CRT_x86.msm
      Microsoft_VC100_CRT_x64.msm

      Look in:

      C:\Program Files (x86)\Common Files\Merge Modules\