Installing Cockpit

Top  Previous  Next

Cockpit Packages

The Cockpit System comes in the form of separate packages. There are two basic types of Packages: Cockpit Library Packages and Cockpit Sample Packages. You can pick the packages you want to use and install them on your machine selectively. Each of those packages contains a Cockpit Library Tree or a Cockpit Sample Tree. Those trees should be installed as a whole starting in any subdirectory you like on your drive. References between files in one package only assume the package tree structure to exist.

Setting up one or two Cockpit Root Folders

On my machine the packages are split between two drives: Drive E: is my library drive. Hence I have all Cockpit Library trees on drive E: starting in the subdirectory E:\Cockpit. Drive D: is my application development drive. All Cockpit sample trees can hence be found in D:\Cockpit.


If you don't have this separation, I'd recommend you create a folder named "Cockpit" on one of your drives, let's assume you put this folder on drive C:. In this "Cockpit" folder you should create the sub folders "Libs" and "Samples".


Now you can install the Cockpit Library Packages below "C:\Cockpit\Libs" and the Cockpit Sample Packages below "C:\Cockpit\Samples". For example the Cockpit Core Library tree would start in "C:\Cockpit\Libs\Core" and the Cockpit Platform Sample Tree would start in "C:\Cockpit\Samples\Platform". Below those directories the trees unfold as recorded in the Zip Package files.

The Contents of the Trees

In the Cockpit Library Packages you will find these folders:



The dynamic link libraries (*.dll files) of the package


The header files (*.ch) of the package


The import libraries (*.lib files) of the package


The source files of the package


The syntax highlight information files of the package


Not every Cockpit Library Package contains all folders.


The Cockpit Sample Packages do not follow a fixed structure. Their sub folders are used to group the sample projects by functional categories. The leaves in all branches contain one sample program.

Getting ready for Action by setting the Environment Variables

Next you must change some environment variables to make sure all required files are found by the compiler, the linker and your applications using Cockpit. This action is required for all Cockpit Library Packages you installed.




Let's start with the "PATH" environment variable. You have to add all "bin" folders of the installed Cockpit Library Packages to the "PATH" variable. How you do that heavily depends on how you normally set up your development and running environment. On my machine I added those paths in Start (button)/Settings/Control Panel/System/Advanced (tab)/Environment Variables... (button)/System variables (lower box) to the "PATH" environment variable. This will make sure that all necessary dlls are found when you start a program, no matter how you start it.


2. LIB


Next you should add the "lib" folders of all installed Cockpit Library Packages to your "LIB" environment variable. Again, how you do that depends on how you set up your development environment. I have a batch file that sets up my Xbase++ development environment. In this batch file I add all the "lib" paths to the current "LIB" setting. In my batch file it looks like this:


SET LIB=c:\Alaska\Xppw32\lib; C:\Alaska\Xbtw32\lib; e:\Cockpit\Core\lib; e:\Cockpit\Platform\lib; ... ; %LIB%


This line will become horribly long when you add all the lib directories, but it's the best way to do it.




Finally you must add the "inc" folders of all installed Cockpit Library Packages to your "INCLUDE" environment variable. Once again, how you do that depends on your environment setup. In my development environment setup batch is a line like this:


SET INCLUDE=c:\Alaska\Xppw32\Include; c:\Alaska\Xbtw32\Include; e:\Cockpit\Core\inc; e:\Cockpit\Platform\inc; ... ; %include%


This line will also become terribly long but it is the best way to do it.


You might be reluctant to set those never-ending environment strings but it's definitely the best way of setting up a proper environment. You might prefer putting all dlls, all .ch files and all lib files in one directory for each type. You can, there should not be any collisions. But all this will change is the size of your environment strings. (And you have less work of typing in those strings manually...) But you are losing one big advantage: When a Cockpit Library Package is revised and some files are removed or renamed, you'll have to take care of the changes manually comparing the files one by one. With the recommended setup you simply remove the complete old Cockpit Package Tree and install the new one in its place.

Distributing your applications using Cockpit Dlls

If course you won't force your customers to set up this environment for your applications. Just put the Cockpit dlls in the same folder as your program or in any other folder scanned through the "PATH" variable for dlls and you're done.