To build StreamBase C++ clients for Windows using Visual C++ 8.0 (Visual Studio 2005), 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.
To configure Visual C++ 8.0 projects to build StreamBase clients, you can either:
-
Copy the
folder to your Visual C++ workspace. For clarity, keep your Visual C++ workspace in a separate location from your StreamBase Studio workspace.streambase-install-dir\sample\clientNote
You must copy this folder from the StreamBase installation directory. Do not make a copy of the
clientsample in your StreamBase Studio workspace, because the Studio workspace sample does not have the Visual Studio.slnand.vcprojfiles. -
Optional. You can remove unnecessary files from the copied project folder. These files are part of the Java and Python client samples and are not used by the C++ client. Remove the
java-srcfolder and all files with the following extensions:.classpath,.project,.html,.txt,.exe,.launch,.csv,.sbapp,.sbfs,.py. -
Locate the
client-vc8.slnfile. You can optionally rename this file before opening it the first time. Preserve the.slnextension, and choose a basename that reflects the purpose of the intended client. For example, renameclient-vc8.slntoAcctDeptLoader.sln. -
Start Visual C++ 8.0. Use → → to load
client-vc8.sln(or your renamed solution file). -
Copy or rename one of the existing projects in the Solution Explorer. For example, if you are creating an enqueuing client, rename
SimpleEnqueuertoAcctDeptLoader. -
In your renamed project folder, rename
SimpleEnqueuer.cppas appropriate for your project (such asAcctDeptLoader.cpp). -
Remove the other two projects from your solution.
-
Right-click your project in the Solution Explorer and select Properties from the context menu.
-
Locate the places in the project properties that use
${STREAMBASE_HOME}and replace those with the absolute path to your top-level StreamBase installation directory. In general, do this by clicking in the specified setting row, then click the button with three dots to open the Additional Directories dialog. Select a row in this dialog and use the second three-dot button to navigate to your StreamBase installation's directory.On the drop-down menu, select .
Make sure the following settings are in place:
Property Folder Property Page Property Row Setting C/C++ General Additional Include Directories Replace the path that uses ${STREAMBASE_HOME}with the absolute path to theincludedirectory of your StreamBase installation:streambase-install-dir\includeLinker General Additional Library Directories Replace the path that uses ${STREAMBASE_HOME}with the absolute path to thelib\$(ConfigurationName)directory of your StreamBase installation. The macro $(ConfigurationName) is replaced at runtime with eitherdebugorreleaseto match the current Solution Configuration setting:streambase-install-dir\lib\$(ConfigurationName) -
Build your project and verify that a working client executable is generated.
-
Begin customizing the source file for your client.
Whether using an existing Visual C++ project or starting with a new one, make sure the project's settings match those described in the following steps. All project settings not listed here are optional, and can be changed to match the requirements of your project.
-
In Visual C++ Studio, select → → .
-
In the New Project dialog, select → , then select either Win32 Console Application or Win32 Project, depending the type of client you are creating.
-
In the Name field, enter a name for your project.
-
In the Win32 Application Wizard dialog, select Application Settings.
-
Under Application Type, select Console application or Windows application, depending on the type of client you are creating.
-
If you already have a C++ file that contains your function, then under Additional options, select Empty project. If you are starting from scratch, leave this check box cleared.
-
Under Additional options, clear the Precompiled header check box.
-
Click . If you have a project already open, click to close that project and open your new project.
-
-
If you already have a C++ file for your client, use Windows Explorer to drag that file to the newly created project folder.
-
Back in Visual C++ Studio, if you dragged a file into the project in step 2, right-click Source Files and select Add to add the new file.
-
In the Solution Explorer panel, right-click the project just created and select from the context menu.
-
In Visual C++ Studio, in the Solution Explorer panel, right-click the project that contains your StreamBase custom client code and select from the context menu.
-
On the drop-down menu, select .
Make sure the following settings are in place:
Configuration Properties Folder Property Page Property Row Setting Configuration Properties General Configuration Type From the drop-down menu, select . Configuration Properties General Use of MFC From the drop-down menu, select . Configuration Properties General Use of ATL From the drop-down menu, select . C/C++ General Additional Include Directories Path to the includedirectory of your StreamBase installation.streambase-install-dir\includeDo not use the environment variable
STREAMBASE_HOMEto define this path (unless you have applied this variable globally as described in StreamBase Command Prompt). If there is already an entry in this row that uses${STREAMBASE_HOME}, replace that entry.Instead, click in the row and use the button with three dots on the right side to open the Additional Include Directories dialog. Select a row in this dialog and use the second three-dot button to navigate to your StreamBase installation's
includedirectory.C/C++ Preprocessor Preprocessor Definitions Add the following definitions: WIN32; STREAMBASE_PTHREAD_DLLLinker Input Additional Dependencies Fill in the Additional Dependencies row with the following entries:
LibsbClient-vc8.lib
LibsbUtil-vc8.lib
pthreads-vc8.lib
WS2_32.lib
xercesLib-vc8.lib
Dbghelp.libIn the Additional Dependencies dialog, make sure the Inherit from project defaults check box is selected.
-
On the drop-down menu, select the configuration.
Make sure the following settings are in place:
Property Folder Property Page Property Row Setting C/C++ Code Generation Runtime Library From the drop-down menu, select . Linker General Additional Library Directories Append the following path to the entries in that row: streambase-install-dir\lib\DebugAs described above, do not use
STREAMBASE_HOMEto define this path. If there is already an entry in this row that uses${STREAMBASE_HOME}, replace that entry.Click in the row and use the button with three dots on the right side to open the Additional Library Directories dialog. Select a row in this dialog and use the second three-dot button to navigate to your StreamBase installation's
lib\Debugsubdirectory. -
On the Configuration drop-down menu, select the Release configuration.
Make sure the following settings are in place:
Property Folder Property Page Property Row Setting C/C++ Code Generation Runtime Library From the drop-down menu, select . Linker General Additional Library Directories Append the following path to the entries in that row: streambase-install-dir\lib\ReleaseAs described above, do not use
STREAMBASE_HOMEto define this path. If there is already an entry in this row that uses${STREAMBASE_HOME}, replace that entry.Click in the row and use the button with three dots on the right side to open the Additional Library Directories dialog. Select a row in this dialog and use the second three-dot button to navigate to your StreamBase installation's
lib\Releasesubdirectory.
Now customize the source file for your client, then build and test it.
