Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

1.5. Building the VCF

Building the VCF is easy. This assumes that you have downloaded it and, if necessary, set up any environment variables. The following sections will discuss building the VCF on specific platforms.

1.5.1. VCF Tools

1.5.1.1. Microsoft Visual C++ 6

The first thing you'll want to do is build the various add-ins for Developer Studio. Open the main workspace found in vcf/build/vc60/add-ins/all.dsw. Build the "Win32 Release" configuration, making sure that the "all" project is the current active project. This should build the VCF New Class add-in, plus project wizards VCFLibraryAppWizard, VPLAppWiz, VCFConsoleWiz, and VCFAppWiz. To verify that these were correctly built go to "File | New..." and click on the "Projects" tab and you should see something like the following:

The red circle indicates the various new Application Wizards that you should see.

1.5.1.2. Microsoft Visual C++ 7/7.1

The first thing you'll want to do is install the various wizards for Developer Studio. To install, navigate to the directory vcf/build/vc70/add-ins (for Visual Studio.NET) OR vcf/build/vc71/add-ins (for Visual Studio.NET2003), and run (double click) Setup.js. This will install the various wizards for use in the IDE. To verify that these were installed correctly, go to "File | New | Projects" and click on the "Visual C++ Projects" directory icon and you should see something like the following:

The red circle indicates the various new Application Wizards that you should see.

1.5.1.3. Microsoft Visual C++ 2005 8.0 (including Express edition)

Till Novemeber of 2006 Microsoft is giving away it's Express edition of Visual C++ 2005. This is a superb IDE for the Windows environment, and I'd urge anyone on a budget to look into it. While it does not come with either ATL or MFC support this is OK, because the VCF gives you everything you'll need for GUI development on Windows, and VC 2005 gives you a great IDE! The following section will address how to get it, and how to set it up for Windows GUI development, as there are a few special files you need to adjust by hand.

You can currently download the Visual C++ Express edition from the Visual C++ Express Edition Download site . Follow the instructions there to install the software. Once VC 2005 is installed you will need to install a recent version of the Win32 Platform SDK. Older versions as far back as the November 2001 SDK work just fine if you have an older copy and don't want or need the absolute latest and greatest from Microsoft.

Once you've installed the SDK, you need to adjust your settings in VC 2005 to reflect this, so it knows to use the SDK files. You must follow these instructions, or things will not work correctly. You can read them at Using Visual C++ 2005 Express Edition with the Microsoft Platform SDK. In case this link ever goes away or changes I'll summarize below:

  • Go to Tools > Options. Select the "VC++ Directories" section under "Projects and Solutions". In the "Show Directories for" drop down, select the following:
    • For "Executable files", add the [Path to SDK]\Bin directory.
    • For "Include files", add the [Path to SDK]\Include directory.
    • For "Library files", add the [Path to SDK]\Lib directory.
    These probably need to be the first items, but it seems to work OK if they are not. Older version of VC++ required the SDK files to be included first, but VC2005 doesn't seem as picky.
  • Find the file "corewin_express.vsprops". This should be in a directory like "C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults", or wherever you installed VC 2005 to. Edit this file so that
    AdditionalDependencies="kernel32.lib"
    							
    becomes
    AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib 
    comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"
    							
  • Edit the "AppSettings.htm" file. You should be able to find this in a directory like this "C:\Program Files\Microsoft Visual Studio 8\ VC\VCWizards\AppWiz\Generic\Application\html\1033\". Comment out lines 441-444.

I'd like to thank Brian Johnson for writing the original instructions explaining how to do this.

Once Yo uhave VC 2005, the first thing you'll want to do is install the various wizards for it. To install them, navigate to the directory vcf/build/vc80/add-ins and run (double click) Setup-vcexpress.js. This will install the various wizards for use in the Express IDE. To verify that these were installed correctly, go to "File | New | Projects" and click on the "Visual C++ Projects" directory icon and you should see something like the following:

1.5.1.4. Apple XCode 1.x

This will explain how to install the project templates that come with the VCF so that you can create VCF enabled applications easily from within XCode.

Create a "VCF" directory in your /Library/Application Support/Apple/Developer Tools/Project Templates/ directory. Then copy all the directories in the vcf/build/xcode/Project Templates/ directory to the new VCF directory you created. Yous should end up with something like this:

Now when you select the "File > New Project..." menu item in XCode, you should see the new project templates in the New Project dialog:

1.5.1.5. Apple XCode 2.x

Use the same instructions for XCode 1.x.

1.5.2. Building the VCF Libraries

1.5.2.1. Win32

1.5.2.1.1. Microsoft Visual C++ 6

The following section deals with building the VCF libraries using the Microsoft Visual C++ 6 IDE.

To build the VCF open the vcf/build/vc60/vcfAllProjects.dsw workspace. This workspace has all the various framework projects, both as static .lib files and DLL projects. To build all the VCF libraries select the "vcfAllLibs" project and make it the active project. Building this project will automatically build the FoundationKit, GraphicsKit, ApplicationKit, NetworkKit, and RemoteObjectKit. The libraries will be built as both static and DLL binaries. To build just the static libraries, build the "vcfAllStaticLibs" project. To build all the libraries as DLL's, build the "vcfAllDynamicLibs" project.

There are several additional projects you can build as well for additional features.

  • The ImageFormats project, which adds support for a wide variety of image formats by using the FreeImage library . Build this if you would like to add this support to your project.

  • The Win32HTMLBrowser (and Win32HTMLBrowser_StaticLib) project, for an HTML browser peer (currently implemented using the Internet Explorer IWebBrowser COM interface, though experiments have been done using the Gecko component from mozilla).

The build will take a bit, so now would be a good time for coffee, tea, or perhaps reading some Dostoevsky...

Once the build is finished you are ready to go ! All binaries will be put in the vcf/bin directory when built.

1.5.2.1.2. Microsoft Visual C++ 7.0

The following section deals with building the VCF libraries using the Microsoft Visual C++ 7.0 IDE.

To build the VCF open the vcf/build/vc70/vcfAllProjects_vc70.dsw workspace. This workspace has all the various framework projects, both as static .lib files and DLL projects. Visual Studio should prompt you to convert the Visual C++ 6 projects into the new Visual Studio 7 format. Click the "Yes to All" option, and all the projects should then get converted. To build all the VCF libraries select the "vcfAllLibs" project and make it the active project. Building this project will automatically build the FoundationKit, GraphicsKit, ApplicationKit, NetworkKit, and RemoteObjectKit. The libraries will be built as both static and DLL binaries. To build just the static libraries, build the "vcfAllStaticLibs" project. To build all the libraries as DLL's, build the "vcfAllDynamicLibs" project.

1.5.2.1.3. Microsoft Visual C++ 7.1

The following section deals with building the VCF libraries using the Microsoft Visual C++ 7.1 IDE.

To build the VCF open the vcf/build/vc71/vcfAllProjects_vc71.dsw workspace. This workspace has all the various framework projects, both as static .lib files and DLL projects. Visual Studio should prompt you to convert the Visual C++ 6 projects into the new Visual Studio 7.1 format. Click the "Yes to All" option, and all the projects should then get converted.

To build all the VCF libraries select the "vcfAllLibs" project and make it the active project.

Building this project will automatically build the FoundationKit, GraphicsKit, ApplicationKit, NetworkKit, and RemoteObjectKit. The libraries will be built as both static and DLL binaries. To build just the static libraries, build the "vcfAllStaticLibs" project. To build all the libraries as DLL's, build the "vcfAllDynamicLibs" project. After having built the VCF for the first time, you can typically open the vcf/build/vc71/vcfAllProjects_vc71.sln solution file instead of the workspace file should you decide to rebuild any of the projects at a later time.

1.5.2.1.4. Microsoft Visual C++ 2005 8.0

The following section deals with building the VCF libraries using the Microsoft Visual C++ 2005 (including the Express Edition) IDE.

To build the VCF open the vcf/build/vc80/vcfAllProjects_vc80.sln workspace. This workspace has all the various framework projects, both as static .lib files and DLL projects. Visual Studio should prompt you to convert the Visual C++ 6 projects into the new Visual Studio 7.1 format. Click the "Yes to All" option, and all the projects should then get converted.

To build all the VCF libraries open the vcf/build/vc80/vcfAllLibs.sln solution file, select the "vcfAllLibs" project, and make it the active project.

Building this project will automatically build the FoundationKit, GraphicsKit, ApplicationKit, NetworkKit, and RemoteObjectKit. The libraries will be built as both static and DLL binaries. To build just the static libraries, build the "vcfAllStaticLibs" project. To build all the libraries as DLL's, build the "vcfAllDynamicLibs" project.

1.5.2.1.5. Microsoft Visual C++ 6 using the Intel C/C++ compiler

The following section deals with building the VCF libraries using the Microsoft Visual C++ 7.0 IDE with the Intel C/C++ compiler installed.

To build the VCF open the vcf/build/icl7/vcfAllProjects_icl7.dsw workspace. This workspace has all the various framework projects, both as static .lib files and DLL projects. To build all the VCF libraries select the "vcfAllLibs" project and make it the active project. Building this project will automatically build the FoundationKit, GraphicsKit, ApplicationKit, NetworkKit, and RemoteObjectKit. The libraries will be built as both static and DLL binaries. To build just the static libraries, build the "vcfAllStaticLibs" project. To build all the libraries as DLL's, build the "vcfAllDynamicLibs" project.

1.5.2.1.6. Borland C++ Compiler

The following section deals with building the VCF libraries using Borland's C++ compiler/linker. This includes the free commandline version.

[Note]Note
Due to restrictions on the free commandline compiler, there is no support for the HTMLBrowser control due to dependencies on Microsoft's ATL library. This is being addressed so that in the near future this will no longer be an issue.

For more information regarding the build instructions for Borland compilers, see the notes in the readme.txt file in vcf/build/bcc/readme.txt.

There are some missing libs that did not get distributed with the Borland compiler install. These are found in the vcf/build/bcc/missing_libs directory. Copy them either to your <PATH_TO_BCB_INST>\Lib directory or the vcf/lib directory.

Make sure that the bcc32.cfg file is correctly set up. You should have some thing like this (assuming you have installed you compiler in "c:\bcb6", if not replace as neccessary):

				
-I"C:\bcb6\Include";"C:\bcb6\Include\vcl";"C:\bcb6\Include\Atl"
-L"C:\bcb6\lib\PSDK";"C:\bcb6\lib";"C:\bcb6\lib\obj";"C:\bcb6\lib\release"

				

The order of the folders is important. Especially for linker folders. So copy them as shown here.

For the Borland Free compiler the bcc32.cfg file should look like this:
				
-I"C:\Borland\BCC55\Include"
-L"C:\Borland\BCC55\lib\PSDK";"C:\Borland\BCC55\lib"

				
Of course replace the "C:\bcb6\" or "C:\Borland\BCC55" part with the appropriate path where you installed the Borland Free compiler.

Make sure you setup environment variables for VCF_BIN, VCF_INCLUDE and VCF_LIB. Without that you can not build and use them. See "Installing the VCF" for more information about how to do this.

Once this is done, you're ready to start issuing make commands. Open up a command prompt and and issue a make command like so:


cd <PATH_TO_VCF>\build\bcc
make -fvcfAllLibs.mak

				

This will build all dynamic and static libs. If for some reason name of your make util is not make.exe open vcfAllLibs.mak and change MK variable to the name of your make util. Do the same thing in vcfAllDynStatLibs.mak.

It's possible to build specific libraries if you don't want (or need) to build everything. To build more specific library or set of libraries you have these options:

  • All static libraries (both debug and release)

    
    make -fvcfAllLibs.mak static_libs
    
    					

  • All dynamic libraries (both debug and release)

    
    make -fvcfAllLibs.mak dynamic_libs
    
    					

  • All static release libraries

    
    make -fvcfAllLibs.mak static_libs_rel
    
    					

  • All static debug libraries

    
    make -fvcfAllLibs.mak static_libs_dbg
    
    					

  • All dynamic debug libraries

    
    make -fvcfAllLibs.mak dynamic_libs_dbg
    
    					

  • All dynamic release libraries

    
    make -fvcfAllLibs.mak dynamic_libs_rel
    
    					

To delete the binaries created during the build process you can use the following commands:

  • All libraries (both debug and release and both static and dynamic)

    
    make -fvcfAllLibs.mak clean
    
    					

  • All static libraries (both debug and release)

    
    make -fvcfAllLibs.mak static_libs_clean
    
    					

  • All dynamic libraries (both debug and release)

    
    make -fvcfAllLibs.mak dynamic_libs_clean
    
    					

  • All static release libraries

    
    make -fvcfAllLibs.mak static_libs_rel_clean
    
    					

  • All static debug libraries

    
    make -fvcfAllLibs.mak static_libs_dbg_clean
    
    					

  • All dynamic debug libraries

    
    make -fvcfAllLibs.mak dynamic_libs_dbg_clean
    
    					

  • All dynamic release libraries

    
    make -fvcfAllLibs.mak dynamic_libs_rel_clean
    
    					

[Note]Note
If you are building with the Borland Free compiler issue the same commands stated above but add this : -DFREECOMP=TRUE. For example:

make -fvcfAllLibs.mak -DFREECOMP=TRUE make -fvcfAllLibs.mak static_libs 
-DFREECOMP=TRUE

				
This way we avoid dependency on ATL and make complete library available to user except WebBrowser control. If you just wan't to build everything there is a batch file free_compiler.cmd. Execute it and wait a bit :).

Most of the examples can be compiled with Borland compiler. All that fall in this category have 2 options for building.

  • build_bcc.bat . With this batch file you can quickly build any sample. It expects that you have already built the release dll version of the VCF libs.
  • You have allso 2 project files for BCB 5 IDE. One is for release dll VCF and another is for debug dll VCF.

To use the Borland IDE project files you need to create a subfolder lib_patch in your CBuilder root folder. In there copy c0x32.obj from <CBuilder root>\Lib folder and rename it to c0w32.obj. Here is a more detailed explanation why this was needed (from the VCF forum):

After quite some time I managed to create set of IDE project files for building VCF examples in BCB 5. Examples excluded in this release are:

  • QTPlayer - This example uses QuickTime SDK that only works with visual C++. All lib files and headers are only MSVC compatibile. If somebody makes a port of this to BCB than this sample could be ported.
  • TexLabel - Can not be compiled with BCB 5. Works only with BCB 6.

Here is one important note about building these samples.

Unfortunately in BCB project file it is not possible to specify custom startup object file. That is necessary with VCF because every example has main procedure. Unfortunately BCB project with windows application forces linkage of c0w32.obj that is startup file that requires winmain procedure. What we need instead is c0x32.obj - startup file that uses main procedure.

The only way I found to trick BCB to use different object file than standard was to create new folder in BCB root folder and copy there c0x32.obj and rename it to c0w32.obj. After that every IDE project file must have this folder placed first in a list of folders with lib files (Project\Options\Directories/Conditionals - line "Library path").

All example project files assume that path of this folder is $(BCB)\lib_patch.

So create folder lib_patch in the root of BCB installation and copy/rename mentioned startup object file. This trick is needed only for windows applications. For console applications it is enough to create standard console project in BCB.

In every folder for an example there are two project files - <projectname>_bcb5.bpr and <projectname>_bcb5_d.bpr . The first one is for a release build and the other is for a debug build. In the <VCFROOT>\Examples folder there are project group files Examples_bcb5.bpg (release projects) and Examples_bcb5_debug.bpg (debug projects).

1.5.2.1.7. MinGW-GCC compiler with the Code::Blocks IDE

This section describes building the VCF + examples in the Code::Blocks IDE ( codeblocks.org). The VCF has only been tested with the more recent "Nightly Build" versions of the C::B IDE (download info at their forum page at forums.codeblocks.org). While version 1.0 RC2 might work, we have had troubles with precompiled header support, and strongly recommend the current Nightly Builds or newer. See instruction at the C::B site for using their IDE. The VCF codeblocks projects are known to work versions 3.4.4 and 3.4.5 of the MinGW-GCC compiler. The VCF projects will not work with 3.4.2 or older.

There are several different Code::Blocks (C::B) workspaces you can use to build the VCF, depending on whether you want to build dynamic libraries, static libraries, or both. Building example VCF apps is also covered. These workspaces are found in the vcf\build\codeblocks directory.

  • Dynamic and static libraries + example VCF applications: open vcfAllProjects.workspace

  • Dynamic libraries only: open vcfAllDynamicLibs.workspace

  • Static libraries only: open vcfAllStaticLibs.workspace

  • Dynamic and static libraries only: open vcfAllLibs.workspace

  • Example VCF applications only: open vcfAllExamples.workspace . Note that you need to build the dynamic libraries before building these examples.

Open the workspace of your choice in the C::B IDE. Available targets include "mingw_Release", "mingw_Debug", or "All" for both Release and Debug versions. Select the targer of your choice (or use the default target of All), make sure that the IDE is set to use the "GCC Compiler" compiler, and choose "Build->Build workspace" to build the libraries (+/- examples). The dynamic libraries (dll's) are placed in vcf\bin, and the dll import libraries and static libraries are placed in vcf\lib. All library names will have the suffix "_mgcc" added to their names to indicate they were built with the MinGW-GCC toolchain.

Building your own apps: The C::B IDE does not provide a great mechanism/wizard for creating an app skeleton, though it does provide a nice generic template mechanism. To start building your own VCF apps, we recommend opening one of the VCF example projects (such as HellowWorld), and saving it as a new project. This will give you an application outline with compiler options set up correctly, and you can add and remove your source files to the project as desired. You can also save an example project using "Project->Save project as user-template" and then create new projects from that template. This works well, but in both of these cases you have to change the name of the output binary through Project->Properties to your application output name.

1.5.2.2. Building with Bakefiles

1.5.2.2.1. The Bakefile utility

Bakefile is a command line tool, so you should feel comfortable using a command line to use this tool. Please download and install the latest version of the Bakefile from its site bakefile.sf.net.

1.5.2.2.2. Patching of the Bakefile utility

There are some issues with Bakefiles that were not resolved by authors of Bakefile till now for some reason. So you may need to fix your local Bakefile executable yourself with a patch that can be downloaded separately.

1.5.2.2.3. Environment Variables

What you need to do at the beginning is to set up the VCF_ROOT environment variable. It should point to the root of VCF.

If you are going to use MS VS IDE and prefer to generate VS6 projects then you need to update the IDE's LIB, INCLUDE and PATH variables (executable directories) with directories appropriate to the VCF.

We will use a Windows specific syntax of the command line in examples below. This does not prevent you from using a Unix specific syntax. For example, we will use %VCF_ROOT%, but you can use $VCF_ROOT instead, if you're attempting this from a unix like command line.

1.5.2.2.4. Baked Make Files

The ready-to-use make files are located at the %VCF_ROOT%\build\bakefiles.gen directory. The directory contains several make files for different compilers that can be used from a command line.

To build the whole VCF you need exactly one of the following make files:

  • GNUmakefile - GNU make + GCC
  • makefile.bcc - Borland make + BCC
  • makefile.gcc - MinGW mingw32-make + GCC
  • makefile.vc - MS nmake + MSVC

So, to compile VCF you just need to make the %VCF_ROOT%\build\bakefiles.gen directory current and run one of the following commands:

  • GNU make
    make -f GNUmakefile
    					
  • Borland make
    make -f makefile.bcc
    					
  • MinGW make
    mingw32-make -f makefile.gcc
    					
  • MS nmake
    nmake -f makefile.vc
    					

Each make file has its own config file with the same extension. There is an exception: GNUmakefile's config file is config.gnu. The config files are located in the same directory.

You can tune your build by modifying options in an appropriate config file. There dependencies between some options are mentioned in a config file. Here are brief descriptions of the options. The most option values may be equal to 1 or 0 only that means on/yes/true or off/no/false.

  • OPTION_SHARED - The result libraries will be static or dynamic. Default: 1.
  • OPTION_DEBUG - The libraries will include debug info or will be optimized for speed. Default: 1.
  • OPTION_PRECOMPILED - Precompiled header files will be created and used where it is possible.
  • OPTION_ALLIN1 - All VCF as a single library, static or dynamic depends on OPTION_SHARED. Default: 0.

The following options show should the appropriate static or dynamic libraries be built. Note, if OPTION_ALLIN1 is 1, that is, all the enabled kits will be linked as a single library, and all the following options that are equal to 0 will not be included into the result library.

The following options are assigned to libraries that can be built as static ones only.

  • OPTION_ZLIB - Compile the zip? Default: 1.
  • OPTION_AGG - Compile AGG? Default: 1.
  • OPTION_LIBJPEG - Compile AGG? Default: 1.
  • OPTION_LIBPNG - Compile PNG? Default: 1.
  • OPTION_LIBMNG - Compile MNG? Default: 0.
  • OPTION_LIBTIFF - Compile TIFF? Default: 0.
  • OPTION_FREEIMAGE - Compile FreeImage? Default: 0.
  • OPTION_REGEXX - Compile PCRE? Default: 0.

The following options are assigned to libraries that can be built as both static and dynamic ones.

  • OPTION_FOUNDATIONKIT - Default: 1.
  • OPTION_GRAPHICSKIT - Default: 1.
  • OPTION_APPLICATIONKIT - Default: 1.
  • OPTION_HTMLKIT - Default: 1 if the compiler is MSVC. Otherwise 0.
  • OPTION_OPENGLKIT - Default: 0.
  • OPTION_NETWORKKIT - Default: 0.
  • OPTION_REMOTEOBJECTKIT - Default: 0.
  • OPTION_INTERNETKIT - Default: 0.
  • OPTION_IMAGEFORMATS - Default: 0.

The following option allows us to define a string that will be a part of the result libraries names.

  • OPTION_SELECTLIB

The value of this option might be some meaningful string that, once set, will be added to the names of the target files. Any string is possible. For example, if the value is _vc6, then the name of, say, the foundation kit debug DLL will be FoundationKit_vc6_d.dll.

You may use the following values to be compatible with the default MSVS projects, that are based on the in-code linking using the preprocessor pragma "comment": _icl6, _icl7, _vc6, _vc70, _vc71, _vc80.

[Note]Note
The default value is an empty string.

The other way to build VCF is to pass the option values in a command line like this:

nmake -f makefile.vc OPTION_SELECTLIB=_vc71 OPTION_DEBUG=0
				

There are the following make targets that can be built independently:

  • ZLib
  • AGG
  • LibJPEG
  • LibPNG
  • LibMNG
  • LibTIFF
  • FreeImage
  • RegExx
  • FoundationKit
  • GraphicsKit
  • ApplicationKit
  • HTMLKit
  • OpenGLKit
  • NetworkKit
  • RemoteObjectKit
  • InternetKit
  • ImageFormats

1.5.2.2.5. Baked Project Files

The ready-to-use VS6 project files are located at the %VCF_ROOT%\build\bakefiles.gen directory. This project does not use the described above config file at all.

Please note, the project contains several configurations that allow us to choose the name of the result libraries:

  • vc80 DLL Debug (based on "Win32 (x86) Dynamic-Link Library")
  • vc80 DLL Release (based on "Win32 (x86) Dynamic-Link Library")
  • vc80 Debug (based on "Win32 (x86) Static Library")
  • vc80 Release (based on "Win32 (x86) Static Library")
  • vc71 DLL Debug (based on "Win32 (x86) Dynamic-Link Library")
  • vc71 DLL Release (based on "Win32 (x86) Dynamic-Link Library")
  • vc71 Debug (based on "Win32 (x86) Static Library")
  • vc71 Release (based on "Win32 (x86) Static Library")
  • vc70 DLL Debug (based on "Win32 (x86) Dynamic-Link Library")
  • vc70 DLL Release (based on "Win32 (x86) Dynamic-Link Library")
  • vc70 Debug (based on "Win32 (x86) Static Library")
  • vc70 Release (based on "Win32 (x86) Static Library")
  • vc60 DLL Debug (based on "Win32 (x86) Dynamic-Link Library")
  • vc60 DLL Release (based on "Win32 (x86) Dynamic-Link Library")
  • vc60 Debug (based on "Win32 (x86) Static Library")
  • vc60 Release (based on "Win32 (x86) Static Library")
  • icl7 DLL Debug (based on "Win32 (x86) Dynamic-Link Library")
  • icl7 DLL Release (based on "Win32 (x86) Dynamic-Link Library")
  • icl7 Debug (based on "Win32 (x86) Static Library")
  • icl7 Release (based on "Win32 (x86) Static Library")
  • icl6 DLL Debug (based on "Win32 (x86) Dynamic-Link Library")
  • icl6 DLL Release (based on "Win32 (x86) Dynamic-Link Library")
  • icl6 Debug (based on "Win32 (x86) Static Library")
  • icl6 Release (based on "Win32 (x86) Static Library")
  • DLL Debug (based on "Win32 (x86) Dynamic-Link Library")
  • DLL Release (based on "Win32 (x86) Dynamic-Link Library")
  • Debug (based on "Win32 (x86) Static Library")
  • Release (based on "Win32 (x86) Static Library")

You need to choose a preferred configuration before you start to build VCF.

If you want to build VCF under your VS7.0, VS7.1 or VS8.0 you just need to convert all files of this project into the actual format as your VS IDE will suggest.

There is no the ready-to-use all-in-one project. However, you are able to generate it if you really need it. How to do this you can find in the section that describes bakefiles.

1.5.2.2.6. Building Examples

Each example has its own baked make file, a name of which is the same as the main make file name. A command to build an example has to be the same as to build VCF. Run a make utility in example's directory to build the example separately. Run a make utility in the "examples" directory to build all the examples.

Note, an example will be built only if a kit that this example uses enabled by setting an appropriate option.

The VS6 project files for examples are not generated, so use non-baked VS projects.

1.5.2.2.7. Using bakefiles in your own project

The easiest approach to create a make file or a VS6 project for your own project using the VCF offers is to use bakefiles. Lets look at the simplest way to start your own VCF project from scratch using your favorite editor.

Say, you created your own helloworld.cpp:

#include "vcf/FoundationKit/FoundationKit.h"

using namespace VCF;

int main( int argc, char** argv )
{
	FoundationKit::init( argc, argv );

	System::println( "Hello world!" );

	FoundationKit::terminate();
	return 0;
}
					

You would like to test it and want to create a make file as easy and as quickly as possible. Create a text file helloworld.bkl as follows:

			
<?xml version="1.0" ?>

<makefile>
	<include file="VCFHelper.bkl"/>

	<exe id="helloworld" template="vcf_exe_console">
		<sources>helloworld.cpp</sources>
		<vcf-use-FoundationKit/>
	</exe>
</makefile>
			
					

That is all. You are ready to generate a make file or a VS6 project. Suppose you want to generate a VS6 project. You just need to run the following command from a command line:

bakefile -I"%VCF_ROOT%\build\bakefiles" -f msvc6prj helloworld.bkl
					

This command will generate helloworld.dsp and helloworld.dsw.

If you prefer to generate a make file just run one of the following commands. Which of them is yours depends on what the compiler you prefer.

This command will generate makefile.vc.

bakefile -I"%VCF_ROOT%\build\bakefiles" -f msvc helloworld.bkl
					

This command will generate makefile.gcc.

bakefile -I"%VCF_ROOT%\build\bakefiles" -f mingw helloworld.bkl
					

This command will generate makefile.bcc.

bakefile -I"%VCF_ROOT%\build\bakefiles" -f borland helloworld.bkl
					

This command will generate GNUmakefile.

bakefile -I"%VCF_ROOT%\build\bakefiles" -f gnu helloworld.bkl
					

As you can see there are different formats (-f parameter) only. There are the following assignments between formats and compilers.

  • msvc - MS VC
  • mingw - MinGW/GCC
  • borland - Borland C++ compiler
  • gnu - GCC

The first three are Windows specific. The last one means a unix-style make file that can be used on Linux, Cygwin and Mac OS X.

Once you execute the bakefile utility as it is described above you will get a make file. Or you will get several make files, if you generate them for different formats. Anyway, one of the following command will build an executable for you:

  • GNU make
    make -f GNUmakefile
    						
  • Borland make
    make -f makefile.bcc
    						
  • MinGW make
    mingw32-make -f makefile.gcc
    						
  • MS nmake
    nmake -f makefile.vc
    						

Let us look at the helloworld.bkl closer. It is an XML file. There are two tags <include> and <exe>. The first one includes the VCFHelper.bkl file that has to be included by any user project:

			
<include file="VCFHelper.bkl"/>
			
					

The <exe> tag defines an executable. It is a console VCF application that has the only source file helloworld.cpp and uses the FoundationKit:

			
<exe id="helloworld" template="vcf_exe_console">
	<sources>helloworld.cpp</sources>
	<vcf-use-FoundationKit/>
</exe>
			
					

Suppose you created a GUI application that uses the ApplicationKit like this.

#include "vcf/ApplicationKit/ApplicationKit.h"

using namespace VCF;

int main( int argc, char** argv )
{
	Application* app = new Application(argc,argv);

	Window* mainWindow = new Window();
	app->setMainWindow( mainWindow );
	mainWindow->setCaption( "Hello World" );
	mainWindow->show();

	Application::main();

	return 0;
}
					

Of course, you need to modify your bakefile as follows.

			
<?xml version="1.0" ?>

<makefile>
	<include file="VCFHelper.bkl"/>

	<exe id="helloworld" template="vcf_exe_gui">
		<sources>helloworld.cpp</sources>
		<vcf-use-ApplicationKit/>
	</exe>
</makefile>
			
					

Please refer to the VCF examples to see how you can prepare a bakefile appropriate to your project. Each example directory contains a bakefile which can be used to learn the bakefiles features that are VCF specific. Please note, all the VCF examples include VCFCommon.bkl instead of VCFHelper.bkl. VCFCommon.bkl and VCFHelper.bkl are similar to each other. However, there is one difference. VCFCommon.bkl defines the bakefile variables that use the relative paths and can be used inside the VCF source tree only. VCFHelper.bkl defines the bakefile variables that use the system environment variable VCF_ROOT and can be used outside of the VCF source tree. In other words, these are two different entry points: VCFCommon.bkl is for the internal use only; VCFHelper.bkl is to use in external custom projects.

As you can see the first bakefile has the <vcf-use-FoundationKit> tag. The second bakefile has the <vcf-use-ApplicationKit> tag. For every kit there is a certain tag.

  • <vcf-use-FoundationKit>
  • <vcf-use-GraphicsKit>
  • <vcf-use-ApplicationKit>
  • <vcf-use-HTMLKit>
  • <vcf-use-OpenGLKit>
  • <vcf-use-NetworkKit>
  • <vcf-use-RemoteObjectKit>
  • <vcf-use-InternetKit>

The VCF contains some thirdparty libraries. You can use them in your project, so you might want to include an appropriate tag in your bakefile. For every library there is a certain tag.

  • <vcf-use-AGG>
  • <vcf-use-ZLib>
  • <vcf-use-LibJPEG>
  • <vcf-use-LibPNG>
  • <vcf-use-LibMNG>
  • <vcf-use-LibTIFF>
  • <vcf-use-FreeImage>

You can just add an include path of a thirdparty library in your project. Here is a list of the appropriate tags.

  • <vcf-include-thirdparty>
  • <vcf-include-boost>
  • <vcf-include-AGG>
  • <vcf-include-ZLib>
  • <vcf-include-LibJPEG>
  • <vcf-include-LibPNG>
  • <vcf-include-LibMNG>
  • <vcf-include-LibTIFF>
  • <vcf-include-FreeImage>

1.5.2.2.8. Regenerating makefiles and VS6 project files
[Note]Note
Please note, you can only run the bakefile_gen executable from the %VCF_ROOT%\build\bakefiles directory.

If you want to regenerate the baked makefiles you need to use the bakefile_gen executable of the Bakefile utility. The following command will regenerate all the baked makefiles of the VCF.

			bakefile_gen -f msvc,borland,msvc6prj,mingw,gnu
					

There are several formats of the result makefiles that are separated by comma. Note, this command executes long time for the first time.

You can regenerate makefiles of a certain format only like this.

			bakefile_gen -f msvc
					

1.5.2.2.9. All-in-1 VS6 project
[Note]Note
Please note, you can only run the bakefile_gen executable from the %VCF_ROOT%\build\bakefiles directory.

There is no all-in-1 VS6 project by default. However, you can generate it yourself. Before you begin you need to delete existing *.dsw and *.dsp files. You can do this by hand file by file; or you can execute the following command that does this job for you.

bakefile_gen -f msvc6prj -c
					

Run the following command to generate the all-in-1 VS6 project.

bakefile_gen -f msvc6prj -DOPTION_ALLIN1=1
					

1.5.2.3. MacOSX

The VCF currently requires OSX 10.2 or better, preferably 10.3. There are projects supplied for XCode. The Project Builder projects have been disconrtinued and are currently not supported as PB has been dropped by Apple, and will not run on newer versions of OS X later than 10.2. You can download the VCF from SourceForge via cvs (see the instructions getting the VCF via CVS).

Once you have downloaded the code you need to make a few environment configurations. Currently the projects depend on having the environment variables VCF_INCLUDE, VCF_BIN, and VCF_LIB defined. This will go away in the near future but for now please define them. To define environment variables in OSX create a ".MacOSX" directory under you home directory. Create a file called "environment.plist" under the .MacOSX directory like so:

cd ~
mkdir .MacOSX
touch .MacOSX/environment.plist
open .MacOSX/environment.plist
				

This will open the environment.plist in the Property List Editor. Add the variables VCF_INCLUDE, VCF_BIN, and VCF_LIB, with VCF_INCLUDE set to "<vcf root>/include", VCF_BIN set to "<vcf root>/bin", and VCF_LIB set to "<vcf root>/lib". You can see an example below:

You may have to logout and log back in to get the environment variables to take effect.

Now you should be ready to open the VCF in XCode or Project Builder. For Xcode open the vcf/build/xcode/vcfAllProjects.pbproj project. For Project Builder open the vcf/build/osx-pb/vcfAllProjects.pbproj project. There are "release" and "debug" targets provided. This was done because we had problems understanding how to work with the whole development/deployment builds. In the future this will almost certainly change.

Each of the "kits" of the VCF are built as Frameworks under Mac OSX. Thus if you have an application you'd like to add VCF support to, you just need to add the appropriate VCF framework kit, such as FoundationKit.framework, GraphicsKit.framework, or ApplicationKit.framework.

1.5.2.4. Linux

Currently the Linux port is in progress and these instructions may change, but here are the current steps to build, as of May 2, 2008.

Some required libs are:

  • XCB
  • fontconfig - make sure you have any neccessary development headers/libraries.
  • The UUID libs - on Ubuntu just add the uuid-dev package.

Building XCB.  First you'll need to install git. Then make sure you have

  • pkgconfig 0.15.0
  • automake 1.7
  • autoconf 2.50
  • libtool 1.5.6
  • check (but see NoCheck if you don't want to install this)
  • xsltproc
  • gperf 3.0.1

Next download xcb. Create a directory somewhere and name it "xcb". Then

cd xcb
git clone git://anongit.freedesktop.org/git/xorg/util/macros
git clone git://anongit.freedesktop.org/git/xorg/lib/libXau
git clone git://anongit.freedesktop.org/git/xcb/pthread-stubs
git clone git://anongit.freedesktop.org/git/xcb/proto
git clone git://anongit.freedesktop.org/git/xcb/libxcb
git clone git://anongit.freedesktop.org/git/xcb/util
				

You'll need to get http://xorg.freedesktop.org/releases/X11R7.0/src/proto/xproto-X11R7.0-7.0.4.tar.gz and unpack it under the xcb as well.

While still in the "xcb" directory begin your build:

cd macros
./autogen.sh
make
sudo make install

export ACLOCAL="aclocal -I /usr/local/share/aclocal"

cd ../xproto-X11R7.0-7.0.4
./autogen.sh
make
sudo make install

cd ../libXau
./autogen.sh
make
sudo make install

cd ../pthread-stubs
./autogen.sh
make
sudo make install

cd ../proto
./autogen.sh
make
sudo make install

cd ../libxcb
./autogen.sh
make
sudo make install

cd ../util
./autogen.sh
make
sudo make install				
				

You may need to add /usr/local/lib to your LD_LIBRARY_PATH, or modify ld.conf.

1.5.3. Library Support by Compiler

The libraries that constitute the VCF and support by various compilers are given in the table below. The VCF is modular by nature, and some parts of the framework are not supported by all compilers. The OSX and Linux ports are in progress, and we welcome support from new developers to help finish these ports (as well as on the Win32 side).

Table 1.1. 

LibraryMS VC 6,7,8BCB5 and freeBCB6 and BDS '06MinGW(GCC)OSX-GCCLinux-GCC
FoundationKitYesYesYesYesYesYes
GraphicsKitYesYesYesYesYesNo
ApplicationKitYesYesYesYesYesNo
OpenGLKitYesYesYesYesYesNo
NetworkKitYesYesYesYesNoNo
InternetKitYesYesYesNoNoNo
HTMLKitYesNoYesNoNoNo
AGGYesYesYesYesYesYes
ZLibYesYesYesYesYesYes
LibPNGYesYesYesYesYesYes
LibJPEGYesYesYesYesYesYes
   Comments or Suggestions?    License Information