Opened 3 years ago

Closed 3 years ago

#16209 closed enhancement (fixed)

Fix building Inkscape with poppler-22.03.0

Reported by: Douglas R. Reno Owned by: Douglas R. Reno
Priority: normal Milestone: 11.2
Component: BOOK Version: git
Severity: normal Keywords:
Cc:

Description

When building Inkscape with Poppler-22.03.0, you'll get:

[ 15%] Generating inkscape-version.cpp
revision is 0a00cf5339, 2022-02-04
Consolidate compiler generated dependencies of target inkscape_base
[ 16%] Building CXX object src/CMakeFiles/inkscape_base.dir/extension/internal/pdfinput/pdf-input.cpp.o
In file included from /usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/c++allocator.h:33,
                 from /usr/include/c++/11.2.0/bits/allocator.h:46,
                 from /usr/include/c++/11.2.0/string:41,
                 from /usr/include/c++/11.2.0/bits/locale_classes.h:40,
                 from /usr/include/c++/11.2.0/bits/ios_base.h:41,
                 from /usr/include/c++/11.2.0/streambuf:41,
                 from /usr/include/c++/11.2.0/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/11.2.0/iterator:66,
                 from /usr/include/glibmm-2.4/glibmm/ustring.h:25,
                 from /usr/include/gtkmm-3.0/gtkmm/dialog.h:6,
                 from /sources/inkscape-1.1.2/inkscape-1.1.2_2022-02-04_0a00cf5339/src/extension/internal/pdfinput/pdf-input.h:21,
                 from /sources/inkscape-1.1.2/inkscape-1.1.2_2022-02-04_0a00cf5339/src/extension/internal/pdfinput/pdf-input.cpp:19:
/usr/include/c++/11.2.0/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = PDFDoc; _Args = {GooString*&, std::nullptr_t, std::nullptr_t, std::nullptr_t}; _Tp = PDFDoc]’:
/usr/include/c++/11.2.0/bits/alloc_traits.h:512:17:   required from ‘static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = PDFDoc; _Args = {GooString*&, std::nullptr_t, std::nullptr_t, std::nullptr_t}; _Tp = PDFDoc; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<PDFDoc>]’
/usr/include/c++/11.2.0/bits/shared_ptr_base.h:519:39:   required from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {GooString*&, std::nullptr_t, std::nullptr_t, std::nullptr_t}; _Tp = PDFDoc; _Alloc = std::allocator<PDFDoc>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/11.2.0/bits/shared_ptr_base.h:650:16:   required from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = PDFDoc; _Alloc = std::allocator<PDFDoc>; _Args = {GooString*&, std::nullptr_t, std::nullptr_t, std::nullptr_t}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/11.2.0/bits/shared_ptr_base.h:1342:14:   required from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<PDFDoc>; _Args = {GooString*&, std::nullptr_t, std::nullptr_t, std::nullptr_t}; _Tp = PDFDoc; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/11.2.0/bits/shared_ptr.h:409:59:   required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<PDFDoc>; _Args = {GooString*&, std::nullptr_t, std::nullptr_t, std::nullptr_t}; _Tp = PDFDoc]’
/usr/include/c++/11.2.0/bits/shared_ptr.h:862:14:   required from ‘std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = PDFDoc; _Alloc = std::allocator<PDFDoc>; _Args = {GooString*&, std::nullptr_t, std::nullptr_t, std::nullptr_t}]’
/usr/include/c++/11.2.0/bits/shared_ptr.h:878:39:   required from ‘std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = PDFDoc; _Args = {GooString*&, std::nullptr_t, std::nullptr_t, std::nullptr_t}]’
/sources/inkscape-1.1.2/inkscape-1.1.2_2022-02-04_0a00cf5339/src/extension/internal/pdfinput/pdf-input.cpp:672:39:   required from here
/usr/include/c++/11.2.0/ext/new_allocator.h:162:11: error: no matching function for call to ‘PDFDoc::PDFDoc(GooString*&, std::nullptr_t, std::nullptr_t, std::nullptr_t)’
  162 |         { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /sources/inkscape-1.1.2/inkscape-1.1.2_2022-02-04_0a00cf5339/src/extension/internal/pdfinput/pdf-input.cpp:25:
/usr/include/poppler/PDFDoc.h:371:5: note: candidate: ‘PDFDoc::PDFDoc()’
  371 |     PDFDoc();
      |     ^~~~~~
/usr/include/poppler/PDFDoc.h:371:5: note:   candidate expects 0 arguments, 4 provided
/usr/include/poppler/PDFDoc.h:139:14: note: candidate: ‘PDFDoc::PDFDoc(BaseStream*, const std::optional<GooString>&, const std::optional<GooString>&, void*, const std::function<void()>&)’
  139 |     explicit PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {});
      |              ^~~~~~
/usr/include/poppler/PDFDoc.h:139:33: note:   no known conversion for argument 1 from ‘GooString*’ to ‘BaseStream*’
  139 |     explicit PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {});
      |                     ~~~~~~~~~~~~^~~~
In file included from /sources/inkscape-1.1.2/inkscape-1.1.2_2022-02-04_0a00cf5339/src/extension/internal/pdfinput/pdf-input.cpp:25:
/usr/include/poppler/PDFDoc.h:132:14: note: candidate: ‘PDFDoc::PDFDoc(std::unique_ptr<GooString>&&, const std::optional<GooString>&, const std::optional<GooString>&, void*, const std::function<void()>&)’
  132 |     explicit PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr,
      |              ^~~~~~
/usr/include/poppler/PDFDoc.h:132:50: note:   no known conversion for argument 1 from ‘GooString*’ to ‘std::unique_ptr<GooString>&&’
  132 |     explicit PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr,
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
make[2]: *** [src/CMakeFiles/inkscape_base.dir/build.make:1539: src/CMakeFiles/inkscape_base.dir/extension/internal/pdfinput/pdf-input.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1475: src/CMakeFiles/inkscape_base.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

I have a patch prepared based off https://gitlab.com/inkscape/inkscape/-/merge_requests/4116/diffs

Change History (4)

comment:1 by Douglas R. Reno, 3 years ago

Owner: changed from blfs-book to Douglas R. Reno
Status: newassigned

comment:2 by Bruce Dubbs, 3 years ago

Could be a sed.

sed -i '/filename_goo,/s/filename_goo.*/std::make_unique<GooString>(uri));/' \
  src/extension/internal/pdfinput/pdf-input.cpp

Applies, but I have not tried to build it.

Last edited 3 years ago by Bruce Dubbs (previous) (diff)

in reply to:  2 comment:3 by Douglas R. Reno, 3 years ago

Replying to Bruce Dubbs:

Could be a sed.

sed -i '/filename_goo,/s/filename_goo.*/std::make_unique<GooString>(uri));/' \
  src/extension/internal/pdfinput/pdf-input.cpp

Applies, but I have not tried to build it.

That sed seems to do the trick

comment:4 by Douglas R. Reno, 3 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.