Jump to content

SwisTrack/Developers/Setting up a development environment/Windows

From Wikibooks, open books for an open world

Visual Studio

[edit | edit source]

Prerequisites

[edit | edit source]

You need the following programs and libraries:

The following libraries are optional and only necessary if you want to use the corresponding cameras:

  • Basler Pylon driver
  • Firewire camera driver

Installing Libraries

[edit | edit source]

Installing OpenCV

[edit | edit source]

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:

  • 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.

Alternatively the OpenCV-2.2.0 installer lets you chose to add OpenCV to your PATH for yourself or for all users.

Installing wxWidgets

[edit | edit source]

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

[edit | edit source]

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

[edit | edit source]

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:

  • Choose Run... from the Windows Start menu.
  • Type subst L: "C:\Program Files" and click OK.

You can also create a shortcut with this command on your desktop.

Checking out the latest SVN Tree

[edit | edit source]

Check out the latest SVN tree from the following location:

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

Compiling and Launching

[edit | edit source]

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

[edit | edit source]

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

[edit | edit source]

Prerequisite

[edit | edit source]

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

Installation

[edit | edit source]

wxWidgets

[edit | edit source]

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

Error with OLE

[edit | edit source]

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

[edit | edit source]

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

Compilation

[edit | edit source]

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.