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.
Follow these steps to configure a new Visual C++ 2010 project to build StreamBase clients:
-
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 , using the full path to your StreamBase installation directory.streambase-install-dir\includeLinker General Additional Library Directories Add , using the full path to your StreamBase installation directory.streambase-install-dir\lib\$(Platform)\$(PlatformToolset)When expressing the path to your StreamBase installation directory, do not use
${STREAMBASE_HOME}unless you have explicitly made a global setting for theSTREAMBASE_HOMEenvironment variable. In the default StreamBase installation, this variable is not set globally. -
Specify
#includeas the first StreamBase-related line of your source files.<streambase/Client.hpp>
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.
Follow these steps to upgrade an existing StreamBase client project to use Visual Studio 2010:
-
If your project files are managed by a version control system, add the new project file format with extension
.vcxproj. -
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 andstreambase-install-dir\lib(64)\Debug...\lib(64)Releasewith, using the full path to your StreamBase installation directory.streambase-install-dir\includeLinker General Additional Library Directories Replace withstreambase-install-dir\lib\$(ConfigurationName), using the full path to your StreamBase installation directory.streambase-install-dir\lib\$(Platform)\$(PlatformToolset)Linker Input Additional Dependencies Remove the following entries:
LibsbClient-vc#.lib
LibsbUtil-vc#.lib
pthreads-vc#.lib
xercesLib-vc#.lib
WS2_32.lib
Dbghelp.libWhen expressing the path to your StreamBase installation directory, do not use
$(STREAMBASE_HOME)unless you have explicitly made a global setting for theSTREAMBASE_HOMEenvironment variable. In the standard, default StreamBase installation, this variable is not set globally. -
In your StreamBase client source files, replace all instances of:
#include "StreamBaseClient.hpp"with:
#include <streambase/Client.hpp>
To distribute your StreamBase client program to a machine that does not have StreamBase installed, you must also include the following:
-
The
pthreads-v100.dllfile fromfor a 32-bit environment, or fromstreambase-install-dir\binfor a 64-bit environment. Install this file in the same directory as your client program's executable.streambase-install-dir\bin64 -
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.DLLandMSVCR100.DLL, and can be copied from:C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\redist\
At that location, look for either
x86orx64directories, under each of which, look forMicrosft.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.msmMicrosoft_VC100_CRT_x64.msmLook in:
C:\Program Files (x86)\Common Files\Merge Modules\
-
