While trying to compile cfdg 3.4.2 with agg-2.6, I encountered the following type issue:
c++ -Isrc-common -Isrc-unix -Iobjs -Isrc-common/agg-extras -I/usr/local/include -Wall -Wextra -Wno-parentheses -std=c++17 -g -D_GLIBCXX_USE_C99_MATH=1 -DNDEBUG -c -o objs/aggCanvas.o src-common/aggCanvas.cpp
In file included from src-common/aggCanvas.cpp:30:
In file included from src-common/aggCanvas.h:33:
In file included from src-common/cfdg.h:40:
/usr/local/include/agg2/agg_pixfmt_rgba.h:2374:22: error: cannot initialize a parameter of type 'int8u *' (aka 'unsigned char *') with an rvalue of type 'pixel_type *'
2374 | make_pix(pix_value_ptr(x, y, 1), c);
| ^~~~~~~~~~~~~~~~~~~~~~
src-common/agg-extras/agg_copy_rect.h:131:27: note: in instantiation of member function 'agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_rgba>, agg::row_accessor<unsigned char>>::copy_pixel' requested here
131 | dstFormat.copy_pixel(rdst.x1 + x, rdst.y1 + y,
| ^
src-common/aggCanvas.cpp:318:18: note: in instantiation of function template specialization 'agg::copy_rect<agg::pixfmt_alpha_blend_gray<agg::blender_gray_pre<agg::gray8T<agg::linear>>, agg::row_accessor<unsigned char>>, agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_rgba>, agg::row_accessor<unsigned char>>>' requested here
318 | agg::copy_rect(srcPixFmt, pixFmt);
| ^
src-common/aggCanvas.cpp:214:9: note: in instantiation of member function 'aggPixelPainter<agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_rgba>, agg::row_accessor<unsigned char>>>::copy' requested here
214 | aggPixelPainter(aggCanvas* canvas)
| ^
/usr/include/c++/v1/__memory/unique_ptr.h:634:30: note: in instantiation of member function 'aggPixelPainter<agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_rgba>, agg::row_accessor<unsigned char>>>::aggPixelPainter' requested here
634 | return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...));
| ^
src-common/aggCanvas.cpp:387:22: note: in instantiation of function template specialization 'std::make_unique<aggPixelPainter<agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_rgba>, agg::row_accessor<unsigned char>>>, aggCanvas *>' requested here
387 | m = std::make_unique<aggPixelPainter<custom32_pixel_fmt>>(this); break;
| ^
/usr/local/include/agg2/agg_pixfmt_rgba.h:2356:48: note: passing argument to parameter 'p' here
2356 | AGG_INLINE static void make_pix(int8u* p, const color_type& c)
| ^
/usr/local/include/agg2/agg_pixfmt_rgba.h:2374:22: error: cannot initialize a parameter of type 'int8u *' (aka 'unsigned char *') with an rvalue of type 'pixel_type *'
2374 | make_pix(pix_value_ptr(x, y, 1), c);
| ^~~~~~~~~~~~~~~~~~~~~~
src-common/agg-extras/agg_copy_rect.h:131:27: note: in instantiation of member function 'agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba16, agg::order_rgba>, agg::row_accessor<unsigned char>>::copy_pixel' requested here
131 | dstFormat.copy_pixel(rdst.x1 + x, rdst.y1 + y,
| ^
src-common/aggCanvas.cpp:318:18: note: in instantiation of function template specialization 'agg::copy_rect<agg::pixfmt_alpha_blend_gray<agg::blender_gray_pre<agg::gray8T<agg::linear>>, agg::row_accessor<unsigned char>>, agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba16, agg::order_rgba>, agg::row_accessor<unsigned char>>>' requested here
318 | agg::copy_rect(srcPixFmt, pixFmt);
| ^
src-common/aggCanvas.cpp:214:9: note: in instantiation of member function 'aggPixelPainter<agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba16, agg::order_rgba>, agg::row_accessor<unsigned char>>>::copy' requested here
214 | aggPixelPainter(aggCanvas* canvas)
| ^
/usr/include/c++/v1/__memory/unique_ptr.h:634:30: note: in instantiation of member function 'aggPixelPainter<agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba16, agg::order_rgba>, agg::row_accessor<unsigned char>>>::aggPixelPainter' requested here
634 | return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...));
| ^
src-common/aggCanvas.cpp:389:22: note: in instantiation of function template specialization 'std::make_unique<aggPixelPainter<agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba16, agg::order_rgba>, agg::row_accessor<unsigned char>>>, aggCanvas *>' requested here
389 | m = std::make_unique<aggPixelPainter<custom64_pixel_fmt>>(this); break;
| ^
/usr/local/include/agg2/agg_pixfmt_rgba.h:2356:48: note: passing argument to parameter 'p' here
2356 | AGG_INLINE static void make_pix(int8u* p, const color_type& c)
| ^
/usr/local/include/agg2/agg_pixfmt_rgba.h:2374:22: error: cannot initialize a parameter of type 'int8u *' (aka 'unsigned char *') with an rvalue of type 'pixel_type *'
2374 | make_pix(pix_value_ptr(x, y, 1), c);
| ^~~~~~~~~~~~~~~~~~~~~~
src-common/agg-extras/agg_copy_rect.h:131:27: note: in instantiation of member function 'agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_argb>, agg::row_accessor<unsigned char>>::copy_pixel' requested here
131 | dstFormat.copy_pixel(rdst.x1 + x, rdst.y1 + y,
| ^
src-common/aggCanvas.cpp:318:18: note: in instantiation of function template specialization 'agg::copy_rect<agg::pixfmt_alpha_blend_gray<agg::blender_gray_pre<agg::gray8T<agg::linear>>, agg::row_accessor<unsigned char>>, agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_argb>, agg::row_accessor<unsigned char>>>' requested here
318 | agg::copy_rect(srcPixFmt, pixFmt);
| ^
src-common/aggCanvas.cpp:214:9: note: in instantiation of member function 'aggPixelPainter<agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_argb>, agg::row_accessor<unsigned char>>>::copy' requested here
214 | aggPixelPainter(aggCanvas* canvas)
| ^
/usr/include/c++/v1/__memory/unique_ptr.h:634:30: note: in instantiation of member function 'aggPixelPainter<agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_argb>, agg::row_accessor<unsigned char>>>::aggPixelPainter' requested here
634 | return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...));
| ^
src-common/aggCanvas.cpp:391:22: note: in instantiation of function template specialization 'std::make_unique<aggPixelPainter<agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_argb>, agg::row_accessor<unsigned char>>>, aggCanvas *>' requested here
391 | m = std::make_unique<aggPixelPainter<customff_pixel_fmt>>(this); break;
| ^
/usr/local/include/agg2/agg_pixfmt_rgba.h:2356:48: note: passing argument to parameter 'p' here
2356 | AGG_INLINE static void make_pix(int8u* p, const color_type& c)
| ^
/usr/local/include/agg2/agg_pixfmt_rgba.h:2374:22: error: cannot initialize a parameter of type 'int8u *' (aka 'unsigned char *') with an rvalue of type 'pixel_type *'
2374 | make_pix(pix_value_ptr(x, y, 1), c);
| ^~~~~~~~~~~~~~~~~~~~~~
src-common/agg-extras/agg_copy_rect.h:131:27: note: in instantiation of member function 'agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_bgra>, agg::row_accessor<unsigned char>>::copy_pixel' requested here
131 | dstFormat.copy_pixel(rdst.x1 + x, rdst.y1 + y,
| ^
src-common/aggCanvas.cpp:318:18: note: in instantiation of function template specialization 'agg::copy_rect<agg::pixfmt_alpha_blend_gray<agg::blender_gray_pre<agg::gray8T<agg::linear>>, agg::row_accessor<unsigned char>>, agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_bgra>, agg::row_accessor<unsigned char>>>' requested here
318 | agg::copy_rect(srcPixFmt, pixFmt);
| ^
src-common/aggCanvas.cpp:214:9: note: in instantiation of member function 'aggPixelPainter<agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_bgra>, agg::row_accessor<unsigned char>>>::copy' requested here
214 | aggPixelPainter(aggCanvas* canvas)
| ^
/usr/include/c++/v1/__memory/unique_ptr.h:634:30: note: in instantiation of member function 'aggPixelPainter<agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_bgra>, agg::row_accessor<unsigned char>>>::aggPixelPainter' requested here
634 | return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...));
| ^
src-common/aggCanvas.cpp:394:22: note: in instantiation of function template specialization 'std::make_unique<aggPixelPainter<agg::pixfmt_custom_blend_rgba<agg::comp_op_adaptor_rgba_pre<agg::rgba8T<agg::linear>, agg::order_bgra>, agg::row_accessor<unsigned char>>>, aggCanvas *>' requested here
394 | m = std::make_unique<aggPixelPainter<customav_pixel_fmt>>(this); break;
| ^
/usr/local/include/agg2/agg_pixfmt_rgba.h:2356:48: note: passing argument to parameter 'p' here
2356 | AGG_INLINE static void make_pix(int8u* p, const color_type& c)
| ^
4 errors generated.
gmake: *** [Makefile:205: objs/aggCanvas.o] Fehler 1
Please check the underlying issue and either adjust the function signature of either function or insert an appropriate cast.
While trying to compile cfdg 3.4.2 with agg-2.6, I encountered the following type issue:
The root cause seems to be that the
make_pixmethod expects for arguments anint8u *(which is immediately casted topixel_type *), butpix_value_ptrreturns apixel_type *, leading to a type error.Please check the underlying issue and either adjust the function signature of either function or insert an appropriate cast.