last update 20 Sep 2009 |
autoconf
version 2.52 or higher is required to build the configure
script, used to detect which features are installed that the CVR-Lib can make use of. The related aclocal
must have version 1.5 or higher.configure
scripts and the make
files.You may also need:
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:
dtester
is your program in the debug version, with all necessary debugging information, without optimizations and the most important thing, with all possible boundary check mechanisms activated (which make the code much slower as usual!).rtester
is your tester program in the release version, which runs much faster than the debug one.ptester
can also be used if you want to profile your code.
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
cvrlib/linux/Makefile
provides many options and targets. Use the targets as usual, i.e. just type make target
The most useful targets are:
configure
script (type ./configure --help
for more information).dot
.
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).
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:
-I
path to headers-L
path to libraries-l
libraries.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.
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.
If you use the CVR-Lib Installer for Windows all required libraries can be directly installed from there.
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.
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.
cvrlib\src\basics, cvrlib\src\imgProc, cvrlib\src\ioBasics, cvrlib\src\io, cvrlib\src\io\png, cvrlib\src\io\jpeg, cvrlib\src\basics, cvrlib\src\math, cvrlib\src\viewer, cvrlib\src\system
, where cvrlib
should be replaced with the absolute or relative path of your cvrlib directory.buildLib.bat
batch file located in cvrlib\win\buildLib
(Perl must be installed!). This will build the libraries in cvrlib\lib
. Additionally all header-files will be collected and placed in cvrlib\lib\headerFiles
.cvrlib.lib
to the debug configuration and rcvrlib.lib
to the release configuration.cvrlib\lib\headerFiles
for all configurations.v_buildDLLversion=0
in the Perl script createMakefile.pl
beforehand.techinfo.rwth-aachen.de
domain, you can get a (maybe outdated) package with all required libraries from here. If you can get this last file, unpack it into the folder cvrlib\win
. Otherwise, you should get the glib, gdk and gtk libraries from here, and install them in the directories cvrlib\win\gtk+
, cvrlib\win\gtk+\gdk
and cvrlib\win\glib
.cvrlib\win\gtk+, cvrlib\win\gtk+\gdk, cvrlib\win\glib
cvrlib\win\lib
glib-1.3.lib, gdk-1.3.lib, gtk-1.3.lib, gmodule-1.3.lib, gthread-1.3.lib
ws2_32.lib
, psapi.lib
and pdh.lib
, with their respective DLLs. The last one (performance data helper) can be found here, or search the Microsoft Knowledge Base for article "Q284996".cvrlib\win\lib
in your PATH-variable. The required seven GTK+ related DLL-Libraries are: gdk-1.3.dll, glib-1.3.dll, gmodule-1.3.dll, gnu-intl.dll, gthread-1.3.dll, gtk-1.3.dll, pthread.dll
. And the pdh.dll
is required to.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.