Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Chart User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

2.4 Building Objective Chart

Objective Chart can be built in many different ways to support a variety of operating systems and VC++/MFC configurations. For example, Objective Chart can be built using any of the currently supported versions of Microsoft Visual Studio. In addition, your build configuration may specify any combination of build flags, such as debug or release, Unicode or ANSI, and static or DLL.

You can obtain prebuilt versions of the libraries by request to Rogue Wave technical support. Prebuilt libraries are available for the currently supported operating systems with their associated supported compilers. We recommend, however, that you build the libraries yourself.

The prebuilt libraries are built with a particular instance of Visual Studio and the Windows operating system. Building the libraries yourself ensures that they are compatible with your version of the compiler and the operating system they are built on.

If you've downloaded the "Packaged For The Web" media or wish to obtain a minimal footprint version of the Objective Chart library, you'll need to become familiar with the product's build environment and conventions.

2.4.1 Using the Build Files

Objective Chart is distributed with build files for the default configuration that includes SRGraphDisplay and all the graph types. You do not need to run the Build Wizard to build the default configuration.

The SRC subdirectory contains build files for the supported versions of Microsoft Visual Studio. These are named chart<ver>.sln (or chartUT<ver>.sln for Objective Chart Utility Toolkit), where <ver> is the Microsoft Visual Studio MFC version.

To build Objective Chart, open the appropriate build file. Once loaded, you'll notice the makefile contains a variety of different build configurations that specify the settings such as debug or release, Unicode or ANSI, static linking or DLL, etc. Choose a particular configuration and build only that library variant, or select the configuration labeled "All Libraries" and build all variants of the Objective Chart library in one build session. To choose a build configuration, simply select one from the Set Active Configuration combo box in Visual Studio. Or start Batch Build and select several variants to be built at once. Then, start the build and go take a break—building the full Objective Chart libraries takes some time.

The following sections provide additional information about the build options.

2.4.1.1 Static Linking

When an application is statically linked with Objective Chart, the application's footprint is affected by how much of the Objective Chart functionality is used. The linker generally only includes the classes that are used. Because the library's object code is placed into the final executable, the .EXE file is correspondingly larger.

2.4.1.2 Dynamic Linking (as a DLL)

While the application footprint may be very small when using the DLL form of the Objective Chart library, the DLL includes all of the classes and functions. Therefore, the combined size of the DLL and the .EXE file may be larger than that of the statically linked version.

Using a DLL library has few advantages if a single application using Objective Chart is distributed. The DLL linking option is useful if a suite of applications, all using Objective Chart, are distributed together. It can reduce the combined file sizes of the suite of programs and reduce the load on the target computer memory when multiple chart applications are loaded at once.


To link to the Objective Chart library as a DLL; add the symbol _OBJCHART_DLL in the Preprocessor Definitions edit box on the Project Settings | C/C++ tab.

2.4.1.3 Compiler Flags

The Objective Chart build files and header files use #ifdef's on several compiler flags to define the configuration variants described in Section 2.4.1, "Using the Build Files."

The standard symbols _DEBUG, _UNICODE, and _AFXDLL are used to select support for debugging, Unicode characters, and linking to MFC as a DLL, respectively.

In addition, the following flags are specific to Objective Chart.

Table 1: Compiler flags

Flag Description
_OBJCHART_DLL Links to the Objective Chart library as a DLL.
_OCNOAUTOLIB Prevents the Objective Chart "autolink" mechanism. If this flag is defined when building the Objective Chart libraries themselves, you need to explicitly list the Objective Chart libraries you wish to link to in your project's link settings.
_OCAUTOLIBNAME Part of the "autolink" mechanism. Names the library to be linked to your project.
_OC_NO_STANDARD_DISPLAY Don't include SRGraphDisplay—used for custom builds using the graph-type specific classes
_OC_ALL_DISCRETE Include all the graph-type specific classes
_OC_DISCRETE Include selected graph-type specific classes
_PIE_GRAPH, _VBAR_GRAPH, etc. Include individual graph-type specific classes
_OC_DON'T_SUPPORT_TEXT_TEMPLATE Don't include support for storing charts as text templates. Because the text template code creates SRGraphDisplay objects, this symbol must be defined if _OC_NO_STANDARD_DISPLAY is defined.

2.4.1.4 Build Target Naming Conventions

The library naming conventions are illustrated below:

2.4.1.5 Build Configuration Options

The following table shows the default library names for the various configurations, following the naming convention described above, where <ver> stands for the current product version number.

Table 2: Default library names

Library Name Obj. Chart Configuration MFC Configuration Unicode Support Build Mode

OC<ver>

Static

Static

No

Release

OC<ver>d

Static

Static

No

Debug

OC<ver>a

Static

DLL

No

Release

OC<ver>ad

Static

DLL

No

Debug

OC<ver>as

DLL

DLL

No

Release

OC<ver>asd

DLL

DLL

No

Debug

OC<ver>u

Static

Static

Yes

Release

OC<ver>ud

Static

Static

Yes

Debug

OC<ver>au

Static

DLL

Yes

Release

OC<ver>aud

Static

DLL

Yes

Debug

OC<ver>asu

DLL

DLL

Yes

Release

OC<ver>asud

DLL

DLL

Yes

Debug


After the libraries are built, they are placed in the <stingray-installdir>\Lib\<compiler>\<arch> directory, where <compiler> is one of the supported compilers listed in the support matrix and <arch> is either x86 or x64. Each configuration is saved to a separate file. Each build configuration has a subdirectory under <stingray-installdir>\Src\objs\<compiler>\<arch>\<configuration> in which object files are placed.

2.4.1.6 Building the Objective Chart Libraries

To build the Objective Chart libraries:

  1. Start Visual Studio.

  2. Ensure that all directory settings are correct. See Section 2.7.3, "Check Visual Studio Paths," in the Stingray Studio Getting Started Guide for details.

  3. Open chart<ver>.sln.

  4. Choose the build configuration to build. Using Batch Build, you can build a single library, all ASCII libraries, all Unicode libraries, or all libraries.

  5. Start the build..


    Building either the 32-bit or 64-bit libraries takes over 270 MB each of disk space. Of that, approximately 205 MB is used by intermediate files that may be deleted, while the library files require approximately 65 MB.

2.4.2 Using the Build Wizard

A Build Configuration Wizard is included for each of the Objective Chart libraries; look for BuildWiz.exe in the Utils and OCUTUtil subdirectories. The Build Wizard is a powerful tool that allows you to build various versions of the OC library with different configurations. In particular, you can build a library version that includes only the graph types that your projects actually use. The binary size of the resulting Objective Chart libraries and DLLs can thus be minimized, which may be a crucial necessity for online and size-constrained software distribution channels.

The Build Configuration Wizard, or Build Wizard for short, is a wizard dialog that allows you to specify exactly which graph types you intend to use in your applications. After answering a few simple questions, the Build Wizard automatically generates a custom tailored makefile to build the Objective Chart library in the configuration you have specified. The name of the libraries can be customized to avoid any potential name collisions or versioning problems.

To build a custom configuration version of the library:

  1. Run the Objective Chart library Build Wizard.

  2. After entering the configuration name (e.g., "MyConfig"), choose either the Standard Build (SRGraphDisplay) or a custom configuration.

  3. If Standard Build is checked, none of the boxes under "Build using separate display classes" should be checked, and vice versa.


    Warning: checking any additional boxes will cause build errors.

  4. For a custom library using the graph-type specific classes, check any combination of graph types in the lower section. Choose a name for the custom libraries.

  5. Rebuild the Objective Chart library. This automatically builds the Foundation (SFL) Library as well.

The Objective Chart Build Wizard generates two header files, OCVer.h and BWDef.h, that define symbols according to your selected build configuration. These files are included in OChart.h, which you normally include in your project. The defined symbols specify the support graph types and the name of the OC library to which your project is to link.

If you want to maintain multiple versions of the OC library on your system, such as a Standard library and a custom library that only supports Pie graphs, you need to maintain multiple versions of OCVer.h, BWDef.h, and OChart.h (with different names). Then you can select which version to use with your project by the version of OChart.h that you include.


Please refer to the Objective Chart Getting Started User's Guide (GettingStarted.chm) for more information on the Build Wizard and its use.

2.4.3 Miscellaneous Build Issues

This section highlights other miscellaneous issues you may encounter when building your libraries.

2.4.3.1 Using Multiple Library Configurations

Whenever the Build Wizard is run, it overwrites sflversion.h in the common include directory and ocver.h in the OC Include directory with the names of the libraries. This information is used to automatically link the libraries to your project.

If you are maintaining more than one library configuration on your system, you can cause problems. Your projects will tend to link to whatever configuration was last setup by the Build Wizard.

In order to avoid problems whenever you switch library configurations, you should run the Build Wizard specifying the desired configuration for each of the Objective Chart libraries.

2.4.3.2 Make Files and Building Directly with nmake

When you build the Stingray libraries in Visual Studio, Visual Studio invokes make files that ship with the product. For information on these underlying make files, and how to build the libraries by invoking nmake on these files directly, see Section 2.3, "Building from the Command Line with nmake," in the Stingray Studio Getting Started Guide.

This section also discusses the issue of building the libraries with 1-byte structure alignment rather than the default 8-byte structure alignment.


Rogue Wave Software does not support building and using the libraries with nonstandard structure alignments. We include this tip as a suggestion only.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.