flaxpdf icon indicating copy to clipboard operation
flaxpdf copied to clipboard

Build fails on Arch linux

Open zxcsvb opened this issue 4 years ago • 2 comments

Attempting to build from the AUR on with arch yeilds:

loadfile.cpp: In function ‘void loadfile(const char*)’:
loadfile.cpp:334:22: error: no match for ‘operator=’ (operand types are ‘std::unique_ptr<GlobalParams>’ and ‘GlobalParams*’)
  334 |   globalParams = new GlobalParams;
      |                      ^~~~~~~~~~~~
In file included from /usr/include/c++/10.2.0/memory:83,
                 from /usr/include/poppler/PopplerCache.h:18,
                 from /usr/include/poppler/XRef.h:40,
                 from /usr/include/poppler/PDFDoc.h:50,
                 from main.h:41,
                 from loadfile.cpp:17:
/usr/include/c++/10.2.0/bits/unique_ptr.h:371:19: note: candidate: ‘std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(std::unique_ptr<_Tp, _Dp>&&) [with _Tp = GlobalParams; _Dp = std::default_delete<GlobalParams>]’
  371 |       unique_ptr& operator=(unique_ptr&&) = default;
      |                   ^~~~~~~~
/usr/include/c++/10.2.0/bits/unique_ptr.h:371:29: note:   no known conversion for argument 1 from ‘GlobalParams*’ to ‘std::unique_ptr<GlobalParams>&&’
  371 |       unique_ptr& operator=(unique_ptr&&) = default;
      |                             ^~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/unique_ptr.h:386:2: note: candidate: ‘template<class _Up, class _Ep> typename std::enable_if<std::__and_<std::__and_<std::is_convertible<typename std::unique_ptr<_Up, _Ep>::pointer, typename std::__uniq_ptr_impl<_Tp, _Dp>::pointer>, std::__not_<std::is_array<_Up> > >, std::is_assignable<_T2&, _U2&&> >::value, std::unique_ptr<_Tp, _Dp>&>::type std::unique_ptr<_Tp, _Dp>::operator=(std::unique_ptr<_Up, _Ep>&&) [with _Up = _Up; _Ep = _Ep; _Tp = GlobalParams; _Dp = std::default_delete<GlobalParams>]’
  386 |  operator=(unique_ptr<_Up, _Ep>&& __u) noexcept
      |  ^~~~~~~~
/usr/include/c++/10.2.0/bits/unique_ptr.h:386:2: note:   template argument deduction/substitution failed:
loadfile.cpp:334:22: note:   mismatched types ‘std::unique_ptr<_Tp, _Dp>’ and ‘GlobalParams*’
  334 |   globalParams = new GlobalParams;
      |                      ^~~~~~~~~~~~
In file included from /usr/include/c++/10.2.0/memory:83,
                 from /usr/include/poppler/PopplerCache.h:18,
                 from /usr/include/poppler/XRef.h:40,
                 from /usr/include/poppler/PDFDoc.h:50,
                 from main.h:41,
                 from loadfile.cpp:17:
/usr/include/c++/10.2.0/bits/unique_ptr.h:395:7: note: candidate: ‘std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(std::nullptr_t) [with _Tp = GlobalParams; _Dp = std::default_delete<GlobalParams>; std::nullptr_t = std::nullptr_t]’
  395 |       operator=(nullptr_t) noexcept
      |       ^~~~~~~~
/usr/include/c++/10.2.0/bits/unique_ptr.h:395:17: note:   no known conversion for argument 1 from ‘GlobalParams*’ to ‘std::nullptr_t’
  395 |       operator=(nullptr_t) noexcept
      |                 ^~~~~~~~~
make[2]: *** [Makefile:438: loadfile.o] Error 1```

zxcsvb avatar Dec 03 '20 23:12 zxcsvb

Looks like Poppler broke the API again. Try an older Poppler.

I probably won't look into this until it breaks for whatever version I have. Patches welcome.

clbr avatar Dec 04 '20 07:12 clbr

globalParams = new GlobalParams; -> globalParams = std::make_unique<GlobalParams>();

uivil avatar Jul 23 '21 12:07 uivil