CImg icon indicating copy to clipboard operation
CImg copied to clipboard

CImg in VS2010 MFC Project

Open Kyudos opened this issue 2 years ago • 3 comments

I'm trying to use CImg in an older project, but I'm having issues. Even after using #define cimg_use_cpp11 0 I get compiler errors about erf not being a member of std. (e.g. from this line (20526): if (_cimg_mp_is_const_scalar(arg1)) _cimg_mp_const_scalar(std::erf(mem[arg1]));).

Should / can I tweak the current version of CImg to work, or should I be using an earlier version? All I really need is to be able to determine the pixel dimensions of JPG, BMP, GIF, PNG, TIF, and PSD images.

Kyudos avatar Jun 29 '23 04:06 Kyudos

I've done some modifications to allow the compilation of CImg with c++98 standard. You may want to try with this file : https://raw.githubusercontent.com/GreycLab/CImg/develop/CImg.h

dtschump avatar Jun 29 '23 06:06 dtschump

I've done some modifications to allow the compilation of CImg with c++98 standard. You may want to try with this file : https://raw.githubusercontent.com/GreycLab/CImg/develop/CImg.h

Thanks that seems to be an improvement. Though I added: #pragma warning(disable:4995) // name was marked as #pragma deprecated #pragma warning(disable:4307) // integral constant overflow

and also Line 30265 gives: error C2666: 'pow' : 6 overloads have similar conversions so needs to be like:

for (longT off = 0; off<(longT)siz; ++off) res+=(double)std::pow((float)cimg::abs(_data[off]),magnitude_type);

Kyudos avatar Jun 29 '23 21:06 Kyudos

Thanks for the info, I've added this : https://github.com/GreycLab/CImg/commit/6099cf166f3f95e8aaa7c2b30754694eeb082989

dtschump avatar Jun 30 '23 06:06 dtschump