Word Gems

A personal interest blog about computergraphics, rendering and usefull C++ and Python stuff.

OpenCV with Visual Studio 2010

If you try to get OpenCV to work with Visual Studio 2010 and get an “Unhandled Exception” while trying out a simple example make sure your program links against the correct .dll!

Make sure you added the path to the folder containing the dll’s build with VS 2010 to your path-enviroment variable, not any other version of Visual Studio, it wont work!

Filed under: C++, Computergraphics, OpenCV

Using Magick++ under Visual Studio 2010

If you try to use Magick++ in your Visual Studio 2010 project you will get all kinds of odd errors.

The reason is not at all obvious, and took me a while to find. ImageMagick, (Magick++) uses STL types in the library interface. Since the implementation of STL container types etc. are compiler-specific, they are not neccessarily compatible between different compilers (not even between compiler versions).

To get the whole thing to fly you got to build ImageMagick with the same compiler as your project. How to build ImageMagick from source is described here http://www.imagemagick.org/script/advanced-windows-installation.php in detail.

Update: After I came back to this topic I found some notes on the imagemagick website concerning the problem:

Note that the DLLs and libraries are built using Visual C++ 7.0 (.net). In order to use Magick++, you must either use the same compiler version used to build the distribution, or download the Windows source package and build everything yourself.

Filed under: C++, ImageMagick