It looks like a structure skew which can come from incorrect compile settings. To start with a sane workspace, go to c:\Program Files\ImageMagick-6.8.1-Q16/Magick++_demos and click on the button workspace, build and execute. If all goes well, you can use that workspace as a template for your own custom codeset.
Not sure why its failing for you, we did a fresh install on 3 Windows systems of ImageMagick-6.8.1-9-Q16 and compiled and ran the button workspace. It compiled and ran without complaint.
I think there is a bug in your function. I enter a string with three chars "BGR" and the errormessage returns ` ¶BGR' ? There is definitively something wrong.
For the future: I think u better should use enums for cases like this....
Of course the exception is right but I didn't commited a string like the exception says
OK, for those who had the same problem. I think i found the solution.
If u use CMake as a buildtool and try to find ImageMagick there only will be linked the release libraries. That was the problem when I run my program MSVC used the release dll instead of the debug dll in debug mode. So I modified the FindImageMagick.cmake to also search for debug libraries.