ropensci / qpdf

Split, Combine and Compress PDF files
https://docs.ropensci.org/qpdf
Other
57 stars 10 forks source link

Compatibility with qpdf 11 #20

Closed QuLogic closed 1 year ago

QuLogic commented 1 year ago

It appears there are a few breaking changes in qpdf 11, which cause a few build errors when compiling:

g++ -std=gnu++14 -I"/usr/include/R" -DNDEBUG -I/usr/include/p11-kit-1  -I'/usr/lib64/R/library/Rcpp/include' -I/usr/local/include   -fpic  -O2  -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection  -c bindings.cpp -o bindings.o
In file included from /usr/include/qpdf/Buffer.hh:26,
                 from /usr/include/qpdf/QPDF.hh:37,
                 from bindings.cpp:1:
/usr/include/qpdf/PointerHolder.hh:31:3: warning: #warning "POINTERHOLDER_TRANSITION is not defined -- see qpdf/PointerHolder.hh" [-Wcpp]
   31 | # warning "POINTERHOLDER_TRANSITION is not defined -- see qpdf/PointerHolder.hh"
      |   ^~~~~~~
bindings.cpp: In function 'QPDF read_pdf_with_password(const char*, const char*)':
bindings.cpp:27:10: error: use of deleted function 'QPDF::QPDF(const QPDF&)'
   27 |   return pdf;
      |          ^~~
/usr/include/qpdf/QPDF.hh:941:5: note: declared here
  941 |     QPDF(QPDF const&) = delete;
      |     ^~~~
bindings.cpp: In function 'int cpp_pdf_length(const char*, const char*)':
bindings.cpp:32:53: error: use of deleted function 'QPDF::QPDF(const QPDF&)'
   32 |   QPDF pdf = read_pdf_with_password(infile, password);
      |                                                     ^
/usr/include/qpdf/QPDF.hh:941:5: note: declared here
  941 |     QPDF(QPDF const&) = delete;
      |     ^~~~
bindings.cpp: In function 'Rcpp::CharacterVector cpp_pdf_split(const char*, std::string, const char*)':
bindings.cpp:41:55: error: use of deleted function 'QPDF::QPDF(const QPDF&)'
   41 |   QPDF inpdf = read_pdf_with_password(infile, password);
      |                                                       ^
/usr/include/qpdf/QPDF.hh:941:5: note: declared here
  941 |     QPDF(QPDF const&) = delete;
      |     ^~~~
bindings.cpp:44:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<QPDFPageObjectHelper>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |   for (int i = 0; i < pages.size(); i++) {
      |                   ~~^~~~~~~~~~~~~~
bindings.cpp: In function 'Rcpp::CharacterVector cpp_pdf_select(const char*, const char*, Rcpp::IntegerVector, const char*)':
bindings.cpp:61:55: error: use of deleted function 'QPDF::QPDF(const QPDF&)'
   61 |   QPDF inpdf = read_pdf_with_password(infile, password);
      |                                                       ^
/usr/include/qpdf/QPDF.hh:941:5: note: declared here
  941 |     QPDF(QPDF const&) = delete;
      |     ^~~~
bindings.cpp: In function 'Rcpp::CharacterVector cpp_pdf_combine(Rcpp::CharacterVector, const char*, const char*)':
bindings.cpp:82:64: error: use of deleted function 'QPDF::QPDF(const QPDF&)'
   82 |     QPDF inpdf = read_pdf_with_password(infiles.at(i), password);
      |                                                                ^
/usr/include/qpdf/QPDF.hh:941:5: note: declared here
  941 |     QPDF(QPDF const&) = delete;
      |     ^~~~
bindings.cpp:84:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<QPDFPageObjectHelper>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   84 |     for (int i = 0; i < pages.size(); i++) {
      |                     ~~^~~~~~~~~~~~~~
bindings.cpp: In function 'Rcpp::CharacterVector cpp_pdf_compress(const char*, const char*, bool, const char*)':
bindings.cpp:98:55: error: use of deleted function 'QPDF::QPDF(const QPDF&)'
   98 |   QPDF inpdf = read_pdf_with_password(infile, password);
      |                                                       ^
/usr/include/qpdf/QPDF.hh:941:5: note: declared here
  941 |     QPDF(QPDF const&) = delete;
      |     ^~~~
bindings.cpp: In function 'Rcpp::CharacterVector cpp_pdf_rotate_pages(const char*, const char*, Rcpp::IntegerVector, int, bool, const char*)':
bindings.cpp:111:55: error: use of deleted function 'QPDF::QPDF(const QPDF&)'
  111 |   QPDF inpdf = read_pdf_with_password(infile, password);
      |                                                       ^
/usr/include/qpdf/QPDF.hh:941:5: note: declared here
  941 |     QPDF(QPDF const&) = delete;
      |     ^~~~
tillea commented 1 year ago

I confirm the Debian package shows the same issue when building against libqpdf-dev version 11.1.0. It would be great if this could be fixed soon.

jeroen commented 1 year ago

Fixed in qpdf 1.3.0 (on cran now).

tillea commented 1 year ago

Am Fri, Oct 07, 2022 at 04:09:18AM -0700 schrieb Jeroen Ooms:

Fixed in qpdf 1.3.0 (on cran now). Uploaded to Debian - thanks a lot for fixing this issue.

QuLogic commented 1 year ago

Works in Fedora as well; thanks!