IM 6.8.7-5, MSVC 12, nearbyint conflict
Posted: 2013-11-13T18:09:13-07:00
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!
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!