hzeller / timg

A terminal image and video viewer.
GNU General Public License v2.0
1.97k stars 74 forks source link

Build failure: `error: 'RsvgRectangle' was not declared in this scope; did you mean 'RsvgHandle'?` #142

Open barracuda156 opened 2 hours ago

barracuda156 commented 2 hours ago
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_graphics_timg/timg/work/timg-1.6.0/src/svg-image-source.cc: In member function 'virtual bool timg::SVGImageSource::LoadAndScale(const timg::DisplayOptions&, int, int)':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_graphics_timg/timg/work/timg-1.6.0/src/svg-image-source.cc:56:5: error: 'RsvgRectangle' was not declared in this scope; did you mean 'RsvgHandle'?
   56 |     RsvgRectangle viewbox;
      |     ^~~~~~~~~~~~~
      |     RsvgHandle
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_graphics_timg/timg/work/timg-1.6.0/src/svg-image-source.cc:58:5: error: 'RsvgLength' was not declared in this scope
   58 |     RsvgLength svg_width, svg_height;
      |     ^~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_graphics_timg/timg/work/timg-1.6.0/src/svg-image-source.cc:59:64: error: 'svg_width' was not declared in this scope; did you mean 'orig_width_'?
   59 |     rsvg_handle_get_intrinsic_dimensions(svg, &out_has_width, &svg_width,
      |                                                                ^~~~~~~~~
      |                                                                orig_width_
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_graphics_timg/timg/work/timg-1.6.0/src/svg-image-source.cc:60:60: error: 'svg_height' was not declared in this scope; did you mean 'orig_height_'?
   60 |                                          &out_has_height, &svg_height,
      |                                                            ^~~~~~~~~~
      |                                                            orig_height_
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_graphics_timg/timg/work/timg-1.6.0/src/svg-image-source.cc:61:61: error: 'viewbox' was not declared in this scope
   61 |                                          &out_has_viewbox, &viewbox);
      |                                                             ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_graphics_timg/timg/work/timg-1.6.0/src/svg-image-source.cc:59:5: error: 'rsvg_handle_get_intrinsic_dimensions' was not declared in this scope; did you mean 'rsvg_handle_get_dimensions'?
   59 |     rsvg_handle_get_intrinsic_dimensions(svg, &out_has_width, &svg_width,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     rsvg_handle_get_dimensions
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_graphics_timg/timg/work/timg-1.6.0/src/svg-image-source.cc:96:18: error: expected ';' before 'viewport'
   96 |     RsvgRectangle viewport = {
      |                  ^~~~~~~~~
      |                  ;
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_graphics_timg/timg/work/timg-1.6.0/src/svg-image-source.cc:108:58: error: 'viewport' was not declared in this scope
  108 |     bool success = rsvg_handle_render_document(svg, cr, &viewport, nullptr);
      |                                                          ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_graphics_timg/timg/work/timg-1.6.0/src/svg-image-source.cc:108:20: error: 'rsvg_handle_render_document' was not declared in this scope; did you mean 'rsvg_handle_render_cairo'?
  108 |     bool success = rsvg_handle_render_document(svg, cr, &viewport, nullptr);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                    rsvg_handle_render_cairo
make[2]: *** [src/CMakeFiles/timg.dir/svg-image-source.cc.o] Error 1
barracuda156 commented 2 hours ago

@hzeller Will it be possible to avoid API which requires rusty version of librsvg? I guess that is the reason why the build fails. Unfortunately, this was introduced already in https://github.com/hzeller/timg/commit/da75ff6aedd5f20ae9d91fa03bc3741711e71aee (so reverting can only work to pre-librsvg code here).