OpenPrinting / cups-filters

filters, backends, driverless utility, ... - Everything which CUPS 2.x needs to be used on non-Mac systems
Apache License 2.0
157 stars 126 forks source link

cups-filters-1.28.17 build failed with >=app-text/qpdf-11.3.0 (error: ‘std::string_view’ has not been declared) #512

Open ArchFeh opened 1 year ago

ArchFeh commented 1 year ago

Describe the bug

/usr/include/qpdf/QPDFWriter.hh:560:32: error: ‘std::string_view’ has not been declared

std::string_view was introduced in c++17, and the ebuild was compiled with c++11, so the error occurs. Can see https://bugs.gentoo.org/898156. When set -std=c++17, comile passed. To Reproduce Steps to reproduce the behavior: just compile with -std=gnu11 or -std=c++11

Expected behavior compile successfully

System Information:

madsl commented 1 year ago

Same issue here, but I don't think the solution is that simple as a search/replace of std=gnu11 to c++11 - for me it seems like the compiler treats these files as C, but it should be parsed as C++. Or something.

Vouivre commented 1 year ago

I have a similar issue on kisslinux. I assume it's the same problem.

Edit: if I downgrade qpdf to 11.2.0 I can compile without problem. For the moment it could be a workaround.

Bonnietwin commented 1 year ago

Same error messages with building the IPFire distribution with qpdf-11.3.0

Building with qpdf-11.2.0 also allowed a problem free compile. That is what I have done at the moment as a workaround.

The IPFire build is using gcc-12.2.0

tillkamppeter commented 1 year ago

You will need -std=c++17 instead of -std=c++11. Please test and report back here.

Bonnietwin commented 1 year ago

I did a fresh build adding -std=c++17 to the cups-filters configure and using qpdf-11.3.0 and it built successfully.

I presume then that even with the latest gcc it must still have the c++11 dialect as default.

Anyway, thanks for the help and I can confirm it worked.

psh0r commented 1 year ago

With clang 15.0.7, -std=c++17 leads to filter/pdftoraster.cxx ISO C++17 does not allow dynamic exception specifications. Building with -std=c++11 works just fine.

See also https://bugs.gentoo.org/901243 Fixed by https://github.com/OpenPrinting/cups-filters/pull/505

dkosovic commented 1 year ago

I assume the correct fix is to do the following modifications to have -std=c++17 added by configure.

Bonnietwin commented 1 year ago

I just ran CXXFLAGS="-std=c++17" before the ./configure command and that worked fine for me.