Page 1 of 1

IM 6.8.7-5, MSVC 12, nearbyint conflict

Posted: 2013-11-13T18:09:13-07:00
by tc33
Hi,

Just got VS 2013 / MSVC 12. I attempted to build ImageMagick 6.8.7-5 in debug/64 bit. I received syntax errors relating to 'nearbyint' in math.h, which is possibly a new function in the MSVC std lib impl, since I was able to compile IM without error on MSVC 11.

It turns out the function #define nearbyint(x) ((ssize_t) ((x)+0.5)) in magick-baseconfig.h (~line 206) conflicts with the one defined in math.h. In fact, I don't know what purpose this function serves, since I can't find any references to it anywhere in the IM project. Once I commented this function out within magick-baseconfig.h, IM compiled successfully.

I recommend removing the definition of nearbyint from magick-baseconfig.h, since it no longer seems to serve the purpose it was intended for (or I'm missing something, which is also very possible). Thanks!

Re: IM 6.8.7-5, MSVC 12, nearbyint conflict

Posted: 2013-11-13T19:30:29-07:00
by magick
Thanks for the problem report. We'll get a patch into the next point release of ImageMagick.

Re: IM 6.8.7-5, MSVC 12, nearbyint conflict

Posted: 2013-11-13T19:52:28-07:00
by tc33
You rock, thanks!