GreycLab / CImg

The CImg Library is a small and open-source C++ toolkit for image processing
http://cimg.eu
Other
1.48k stars 282 forks source link

invalid pure specifier (only ‘= 0’ is allowed) before ‘<=’ token #352

Open t2dk49580 opened 2 years ago

t2dk49580 commented 2 years ago

invalid pure specifier (only ‘= 0’ is allowed) before ‘<=’ token

line: 38682 38746 38813 38881

dtschump commented 2 years ago

Looks like a duplicate of https://github.com/dtschump/CImg/issues/347

t2dk49580 commented 2 years ago

CIMG conflicts with httplib. If CIMG first #include, httplib will report an error, and if httplib first #include, CIMG will report an error. Please help solve it

dtschump commented 2 years ago

After investigation, it appears httplib include resolv.h which define macro _res (l.162). CImg uses _res as a variable name which creates the conflict.

Defining _res as a macro is really awful. Macros in a header file should be at least prefixed with something to avoid this kind of troubles.

I've renamed my variables _res to _resu as a workaround: https://github.com/dtschump/CImg/commit/a01439210974d9f285e3c93750f26cf276f5ffb5