CVR-Lib last update 20 Sep 2009

Some Tips for the supported compilers

Linux/GCC

Requirements

To compile the CVR-Lib using all its power, you will need the following:

You may also need:

Compile the CVR-Lib

First, check if the configure script already exists in your cvrlib/linux directory. If not, of if you are not sure that this is the correct one, just execute in your BASH terminal

cd cvrlib/linux
make -f Makefile.cvs

After that, you can configure your installation with

./configure

You can of course customize your installation with several options (type ./configure --help for more information).

Now you can compile the debug and release libraries and testers with

make

You can at this point make use of your local copy of the library. The cvrlib/tester/cvrTester.cpp file can be used to try out small programs. You can create two executable test programs with:

make dtester rtester

This will create in cvrlib/bin two executable files:

Every *.cpp file in the cvrlib/linux/workbench directory will also be compiled and linked to the tester/rtester programs, so that you can build more complex test applications.

You can also install the library in your system, assuming you have write privileges for the --prefix directory given in the configure script (if nothing was given, /usr/local is the default). Just try:

make install

The Makefile

The Makefile in cvrlib/linux/Makefile provides many options and targets. Use the targets as usual, i.e. just type
make target
in your xterm, konsole, or whatsoever bash-terminal you are using. Using make without target is equivalent to calling target all-debug and all-release, thus building the library and testers in debug and release version.

The most useful targets are:

With the variable DEBUGEXC set to -D_DEBUG_EXCEPTION you can control if the cvr::exceptions will write to std::err a text message that should help you to debug your programs. However, this can (or should) be set in your extrapaths.mk file, in order to survive your next "configure" (see the next section for more information).

Using external libraries and header files

For the use of many frame-grabbers and other hardware related classes, it is usually required that some special hardware drivers or hardware related libraries can be linked with the CVR-Lib. For these and many other special cases it is desirable to have a simple way to indicate:

Include paths are required by almost any frame-grabber or camera utility, except if you provide that all headers can be found in the standard system include paths.

Library paths are only necessary if you also specify some libraries to be linked with, which are not located in the standard library directories (e.g. /usr/lib or /usr/local/lib).

The mechanism provided by the CVR-Lib should "survive" a ./configure, since otherwise you would need to make changes to the Makefile each time you get a newer library version or you just want to reconfigure some options.

You just need to create a file called "extrapaths.mk", in which following variables are expected:

For example, to use the cvr::microEnablePulnix frame-grabber/camera functor, you should include in "extrapaths.mk" following three lines

EXTRAINCLUDEPATH = -I/usr/src/menable/include
EXTRALIBPATH = -L/usr/src/menable/lib
EXTRALIBS =  -lpulnixchanneltmc6700 -lmenable

Please note the standard GCC flags used to indicate:

There is a template for such a file in the linux directory: "extrapaths_template.mk". It contains examples for the Philips ToUCam and for Pulnix + MicroEnable framegrabber.

Examples

In the directory cvrlib/examples you can find several directories with simple code examples using the CVR-Lib. You can copy any Makefile in a project of your own, in order to use the CVR-Lib without much overhead.


Microsoft Visual C++

Requirements

The CVR-Lib makes use of some C++ features and system functionality that makes following requirements necessary:

If you use the CVR-Lib Installer for Windows all required libraries can be directly installed from there.

creation

A project that uses the CVR-Lib can either be created manually or you can let a PERL-script do the job for you. Nevertheless you should read the section about the manual creation of a project to see which settings are required.

There are always two possibilities to work with the CVR-Lib: either as source code or as static library. The first method is required if you want to make changes to existing library sources. The second is preferable if you only want to use the library or to develop new classes.

Automatic creation of a new project

In cvrlib\win you will find the folders console_src, console_lib and tester.

Each contains a PERL script that generates a console project (.dsp and .dsw files) with default settings. If the project files already exist, then the scripts will only perform an update. A relative path to the sources is assumed, i.e. if you want to move your project's location, you will have to change settings manually.

The console_lib project assumes you have already created and installed the library. To do this go to the directory cvrlib\win\buildLib and execute the batch file buildLib.bat. Don't forget to set up your environment variables using the VCVARS32.BAT file provided in your Visual C++ distribution (usually in directory VC98\Bin.

These scripts assume you have installed the GTK+ libraries. We recommend you to install them, in order to use the visualization classes of the CVR-Lib. Using the Windows Installer, this is simply a check box in the offered packages.

For example, let us assume, you are in the installation path of the library. You can create a simple tester project with:

cd cvrlib\win\tester
perl tester.pl --new

After that, you can open the tester.dsw file with the Visual Studio and compile both, debug and release versions, as usual.

Manual creation of a new project.

The following instructions apply, if you create a new project and want to adjust settings manually.

The cvr::processInfo class requires for Windows the libraries pdh.lib and pdh.dll, which are assumed to be in your default path. The cvr::url class requires the libraries ws2_32.lib and ws2_32.dll, which should be already in your default path.

Also check the CVR-Lib Tutorial which contains many screenshots of the installer for windows.


Generated on Sun Sep 20 22:08:32 2009 for CVR-Lib by Doxygen 1.5.8