Skip to content

Setup Windows Requirements

ricardo kloss edited this page Jun 29, 2016 · 11 revisions

Download Requirements

  • CMake: Donwload it here

  • Visual Studio: You can download a free version of Visual Studio Express (For instance, VS 2013).

  • OpenCV: Its built binaries are available to download (VS 2012 and VS2013, VS2014 with opencv 3.1). Similar to boost, choose a build you want to download and unpack the self-extracting archive to a local directory. For Instance, C:/local/opencv.

Setup Requirements

Enviroment Variables

First we have to set environment variables to make our work easier. This will hold the build directory of our Boost and OpenCV library that will be searched by CMake. If you do not set the environment variables, you must specify the directories manually.
Start up a command window (requires admin rights) and enter:

setx -m OPENCV_DIR C:\local\opencv\build\

For this example we are considering that you have extracted OpenCV to the local directory C:\local\opencv.

There is an easy tool for editing environment variables: Rapid Environment Editor, which claims full support for all major OS versions, including 64-bit.

Edit System Path

Now you need to add the bin folders path to the systems path. That is because you will use the Boost and OpenCV library in the form of “Dynamic-link libraries” (also known as DLL). Inside these are stored all the algorithms and information the libraries contains. The operating system will load them only on demand, during runtime. However, to do this he needs to know where they are. The systems PATH contains a list of folders where DLL's can be found. Add the libraries path to this and the OS will know where to look if he ever needs the Boost and OpenCV binaries. Otherwise, you will need to copy the used DLL's right beside the applications executable file (exe) for the OS to find it, which is highly unpleasant if you work on many projects.

  1. Select Computer from the Start menu.
  2. Choose System Properties from the context menu.
  3. Click Advanced system settings > Advanced tab.
  4. Click on Environment Variables, under System Variables, find PATH, and click on it.
  5. In the Edit windows, modify PATH by adding the location of the class to the value for PATH. In order to add an entry to your path, you need to precede the folder name with a semi-colon. So, you have to add the following to the end of the Variable value field: ;%OPENCV_DIR%\bin;%OPENCV_DIR%\x64\vc12\;.
  6. Restart the computer for the changes to take effect.

Here you can also use the Rapid Environment Editor.


References