Stingray Studio : Objective Views User’s Guide : Chapter 2 Getting Started with Objective Views
Chapter 2 Getting Started with Objective Views
Building the Objective Views Libraries
After you have installed Objective Views, you need to build the Objective Views libraries before you can begin using the classes included with Objective Views.
You should take care to ensure that the libraries you build are exactly compatible with your version of the compiler and operating system. If you have difficulties, contact Perforce Technical Support according to the terms of your support agreement.
Objective Views ships with all of the makefiles and project files (VC++ solution files) required to build the various configurations of the library. The Build Wizard, a utility that generates Objective Views makefiles, is also shipped with the product so that you can easily reconfigure the makefiles and change the generated library names.
The Objective Views library can be built as a static library or as a DLL. It can also be built to support either the Unicode or ASCII character sets, and each configuration can be built with debug information or in release mode. The various configuration options result in twelve combinations for the build.
Objective Views relies on the Stingray Foundation Libraries, which are installed with makefiles and run automatically when you build Objective Views. Objective Views also relies on RWUXTheme libraries. You can build the RWUXTheme libraries from <stingray-installdir>\Src\StingrayLibraries<ver>.sln or from solutions in the <stingray-installdir>\RWUXTheme\Src directory.
NOTE >> Do not launch Visual Studio to build SFL (Stingray Foundation) libraries. They will be automatically built while you build the OV libraries.
1. Run the OV BuildWizard if necessary, refer to “Build Wizard” for details. (There is nothing to check or uncheck).
2. Launch Visual Studio.
3. Build the Objective Views libraries.
NOTE >> During the install process, the Stingray Foundation Libraries are installed in addition to the Objective Views library. The SFL library contains classes that provide general functionality to each of our MFC C++ class libraries.
To build the Objective Views libraries, the Visual Studio environment must be configured with directory paths to the include files and libraries. Please refer to “Stingray Studio Paths in Property Sheets” in the Getting Started part for more detailed information about these paths.
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.
Please refer to the “Build Wizard” section in the Getting Started Guide for more information on changing library names.
Naming Conventions
Objective Views uses the following naming scheme to distinguish between the various build configurations of Objective Views libraries. The library names can be changed using the Build Wizard, which is explained later in this section.
Note that the product version number refers to the version number for Objective Views, not Visual Studio. If you use Objective Views with more than one version of Visual Studio, consider altering the library names to distinguish among compiler versions.
Figure 1 – Objective Views naming conventions
 
Build Configurations
The following table lists all of the library configurations supported and the default library name for each configuration, where <ver> stands for the current product version number.
Table 2 – Possible library configurations and their default names 
Configuration Name
Default Library Name
Win32 Lib MFC Lib Debug
ov<ver>d
Win32 Lib MFC Lib Release
ov<ver>
Win32 Lib MFC Dll Debug
ov<ver>ad
Win32 Lib MFC Dll Release
ov<ver>a
Win32 Dll MFC Dll Debug
ov<ver>asd
Win32 Dll MFC Dll Release
ov<ver>as
Win32 Lib MFC Lib Unicode Debug
ov<ver>ud
Win32 Lib MFC Lib Unicode Release
ov<ver>u
Win32 Lib MFC Dll Unicode Debug
ov<ver>aud
Win32 Lib MFC Dll Unicode Release
ov<ver>au
Win32 Dll MFC Dll Unicode Debug
ov<ver>asud
Win32 Dll MFC Dll Unicode Release
ov<ver>asu
Win32 All ANSI
N/A
Win32 All Unicode
N/A
Win32 All
N/A
NOTE >> If you are dynamically linking to an Objective Views DLL, you must add the directory containing the DLL to your path or manually copy the Objective Views DLL to your Windows directory.
Building with Visual Studio
A Visual Studio solution file is supplied that can be used to build each configuration of the library. These files are located in the <stingray-installdir>\Src directory.
The solution contains a single project with all of the configurations listed above. The following list of steps can be used to build one or more configurations of the library.
1. Start Microsoft Visual Studio.
2. Open the solution file appropriate to your compiler.
3. From the Build menu in Visual Studio, select Set Active Configuration and then choose the build configuration that suits your needs. By default, Win32 All is selected, which builds all combinations of the Objective Views library. The Unicode configuration builds all the libraries that support Unicode. All of the other configurations build one specific library. afxlib indicates that MFC will be linked statically and afxdll indicates the MFC will be used as a DLL.
Figure 2 – Setting the Active Configuration
4. From the Build menu in Visual Studio, select Build Views## to build the selected library. (The symbols ## refer to the compiler version, for example 11 for VC++ 11.0.) Visual Studio will then build the selected libraries and copy them into the <stingray-installdir>\Lib directory.
Figure 3 – Building the library
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 “Building from the Command Line with nmake” in the Getting Started part.
This section also discusses the issue of building the libraries with 1-byte structure alignment rather than the default 8-byte structure alignment.
Stingray Foundation Library
Objective Views relies on the Stingray Foundation Library (SFL), which is installed with the product. SFL is installed with a makefile that is run automatically when you build Objective Views. The Build Wizard can also be used to reconfigure the SFL makefile and change the library names. Refer to the Stingray Foundation Library User’s Guide for more information about building the SFL libraries.
Cleaning Build Targets
The intermediate object files produced when building the Objective Views libraries can require a significant amount of disk space on your computer. After building the libraries, it is recommended that you delete these files to free up space on your hard drive. A batch file is installed which allows you to delete all of the object files, precompiled headers, and other intermediate files produced by the build process. To clean these files, execute the file <stingray-installdir>\Src\BldClean.bat. Note that BldClean.bat will remove intermediate files for all Stingray Studio products that you have installed – not just the Objective Views libraries.
Build Wizard
The Views<ver>.vcxproj file contained by the Views<ver>.sln solution invokes NMAKE with a different target name for each configuration. The makefile passed to NMAKE is called Views.mak, and it is generated by the Stingray Build Wizard utility. The Build Wizard is a makefile generator that allows you to select various library build options and creates a makefile. Running the Build Wizard is optional because a default makefile is installed with Objective Views. You only need to run the Build Wizard if you need to do one of the following.
*Customize library names
*On a machine running Windows earlier than 6.0 (Vista), uncheck the "Embed UAC Manifest" option
The Build Wizard can be run by selecting Programs>Stingray Studio>Product Name>Build Tools>Objective Views Build Wizard from the Windows Start menu, where Product Name is the Stingray Studio product that you have installed. It can also be run by double-clicking on the ViewsBuildWiz.exe program in your <InstallDir>\Utils directory.
Please refer to the “Build Wizard” section in the Getting Started Guide for more information.