SwisTrack/Developers/Setting up a development environment/Windows

= Visual Studio =

Prerequisites
You need the following programs and libraries:


 * Microsoft Visual Studio 2005 or 2008 (the source comes with VS 2005/2008 solutions)
 * Subversion (command line interface), or TortoiseSVN (graphical user interface)
 * Intel Open Source Computer Vision Library (OpenCV)
 * wxWidgets

The following libraries are optional and only necessary if you want to use the corresponding cameras:
 * Basler Pylon driver
 * Firewire camera driver

Installing OpenCV
Download OpenCV 1.0 and install it using the provided installer in C:\Program Files\OpenCV. After the installation, you need to add OpenCV's bin directory to your PATH variable: Alternatively the OpenCV-2.2.0 installer lets you chose to add OpenCV to your PATH for yourself or for all users.
 * Open the Control Panel and double-click the icon System.
 * Choose the Advanced tab.
 * Click on Environment Variables
 * Select Path from the System variables and click Edit
 * Verify that the path contains C:\Program Files\OpenCV\bin; in front of the text and click OK.

Installing wxWidgets
Download wxWidgets 2.8.4 and install it in C:\Program Files\wxWidgets. (Note that this is not the default location, so you have to explicitly tell the installer to put the files in this folder.) Open C:\Program Files\wxWidgets\build\msw\wx.dsw with Visual Studio and compile it (Build - Build Solution F7). By default, wxWidgets is built in debug mode, with the Solution Configuration called "Debug". You may want to build both "Debug" and "Release".

Installing Optional Libraries
If you have a Basler Gbit or FireWire camera, install the Pylon driver in C:\Program Files\Basler.

If you have a FireWire camera, install the 1394camera driver in C:\Program Files\1394camera.

Mounting the L: Drive
The build process for SwisTrack is configured to look for libraries on the L: drive. This allows you to install the libraries wherever you want (we suggested C:\Program Files here), and map this folder as L: as follows: You can also create a shortcut with this command on your desktop.
 * Choose Run... from the Windows Start menu.
 * Type subst L: "C:\Program Files" and click OK.

Checking out the latest SVN Tree
Check out the latest SVN tree from the following location:

https://swistrack.svn.sourceforge.net/svnroot/swistrack

Compiling and Launching
From the checked out SVN tree, open code/Visual Studio/SwisTrack.sln. Select the solution configuration Debug and compile it (Build - Build Solution F7). Visual Studio will now compile libtsai (with a few warnings), SwisTrack-Core and SwisTrack-GUI. The final executable is stored as SwisTrackEnvironment/SwisTrack - Debug.exe.

If you are using a Gbit or a FireWire camera, use the solution configuration Debug - Gbit camera resp. Debug - FireWire camera. Note that these configurations require the corresponding drivers to be installed.

For each debug configuration, there is a corresponding release configuration which builds SwisTrack with optimizations and without debug information.

Error with OLE
Perhaps, you can get a wxWidgets error containing "Error: Cannot initialize OLE". It is not problematic, but you can remove this error by removing OLE in wxWidgets. Other components need also to be changed. This modifications have to be done in the file include/wx/msw/setup.h. Set wxUSE_DRAG_AND_DROP, wxUSE_CLIPBOARD, wxUSE_OLE and wxUSE_OLE_AUTOMATION to 0 (instead of 1). Then (re)compile wxWidgets.

= Cygwin =

Prerequisite
This section just describes the differences with the Visual Studio. You need the following programs and libraries:


 * Cygwin
 * Subversion (command line interface), or TortoiseSVN (graphical user interface)
 * Intel Open Source Computer Vision Library (OpenCV)
 * wxWidgets

wxWidgets
A description about how to compile wxWidgets with cygwin can be found here

Error with OLE
Like for Visual, you can disable OLE support, using configure with the --disable-ole --disable-clipboard --diable-dnd options.

e.g. ./configure --with-msw --disable-shared --disable-ole --disable-clipboard --diable-dnd

OpenCV
Install OpenCV package on your computer and then follow this page.

Compilation
You just have to modify the Makefile.inc file (root directory) to suit your installation. Here are the lines, modify them according to your installation:

OPENCV_CPPFLAGS   := -I/usr/local/include/opencv

OPENCV_LDLIBS     := -lcxcore -lcv -lhighgui -lcvaux -lml

WXWIDGETS_CPPFLAGS := `/cygdrive/l/wxWidgets/wx-config --version=2.8 --cppflags`

WXWIDGETS_LDLIBS  := `/cygdrive/l/wxWidgets/wx-config --version=2.8 --libs`

Then you can use the make cygwin command to compile the whole project.