Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with C++20 and PoDoFo >= 0.10 #9875

Closed
antonio-rojas opened this issue May 8, 2024 · 3 comments · Fixed by #9878
Closed

Build fails with C++20 and PoDoFo >= 0.10 #9875

antonio-rojas opened this issue May 8, 2024 · 3 comments · Fixed by #9878
Assignees

Comments

@antonio-rojas
Copy link

What is the bug?

New poppler 24.05 requires C++20, but gdal fails to build with it

[ 95%] Building CXX object ogr/ogrsf_frmts/mssqlspatial/CMakeFiles/ogr_MSSQLSpatial.dir/ogrmssqlspatialdatasource.cpp.o
cd /build/gdal/src/build/ogr/ogrsf_frmts/mssqlspatial && /usr/bin/c++ -DDONT_DEPRECATE_SPRINTF -DGDAL_COMPILATION -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -Dogr_MSSQLSpatial_EXPORTS -I/build/gdal/src/gdal-3.8.5/apps -I/build/gdal/src/gdal-3.8.5/alg -I/build/gdal/src/gdal-3.8.5/gcore -I/build/gdal/src/build/gcore -I/build/gdal/src/gdal-3.8.5/port -I/build/gdal/src/build/port -I/build/gdal/src/gdal-3.8.5/ogr -I/build/gdal/src/gdal-3.8.5/ogr/ogrsf_frmts -I/build/gdal/src/gdal-3.8.5/frmts -I/build/gdal/src/build/gcore/gdal_version_full -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/gdal/src=/usr/src/debug/gdal -flto=auto -fvisibility=hidden -std=gnu++20 -flto=auto -fno-fat-lto-objects -fPIC -Wall -Wextra -Winit-self -Wunused-parameter -Wmissing-declarations -Wlogical-op -Wshadow -Wmissing-include-dirs -Wformat -Werror=format-security -Wno-format-nonliteral -Werror=vla -Wno-clobbered -Wdate-time -Wnull-dereference -Wextra-semi -Wfloat-conversion -Wnon-virtual-dtor -Woverloaded-virtual -Wsuggest-override -fno-operator-names -Wzero-as-null-pointer-constant -MD -MT ogr/ogrsf_frmts/mssqlspatial/CMakeFiles/ogr_MSSQLSpatial.dir/ogrmssqlspatialdatasource.cpp.o -MF CMakeFiles/ogr_MSSQLSpatial.dir/ogrmssqlspatialdatasource.cpp.o.d -o CMakeFiles/ogr_MSSQLSpatial.dir/ogrmssqlspatialdatasource.cpp.o -c /build/gdal/src/gdal-3.8.5/ogr/ogrsf_frmts/mssqlspatial/ogrmssqlspatialdatasource.cpp
In file included from /usr/include/c++/14.1.1/chrono:45,
                 from /usr/include/podofo/main/PdfDate.h:10,
                 from /usr/include/podofo/podofo.h:41,
                 from /build/gdal/src/gdal-3.8.5/frmts/pdf/pdfsdk_headers.h:120,
                 from /build/gdal/src/gdal-3.8.5/frmts/pdf/gdal_pdf.h:55,
                 from /build/gdal/src/gdal-3.8.5/frmts/pdf/pdfcreatefromcomposition.cpp:30:
/usr/include/c++/14.1.1/sstream:457:7: error: ‘struct std::__cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>::__xfer_bufptrs’ redeclared with different access
  457 |       struct __xfer_bufptrs
      |       ^~~~~~

Steps to reproduce the issue

Build gdal with -DCMAKE_CXX_STANDARD=20

Versions and provenance

Arch Linux x86_64
gdal 3.8.5
gcc 13.1 and 14.1
podofo 0.10.3
poppler 24.05 (irrelevant, also happens with older poppler)

Additional context

No response

@rouault
Copy link
Member

rouault commented May 8, 2024

This has been fixed in upcoming 3.9.0 per 60dcddb . You may cherry-pick it

@rouault rouault closed this as completed May 8, 2024
@antonio-rojas
Copy link
Author

Thanks, but it's quite the opposite: the commit you linked is causing the issue, which is that gdal fails to compile with C++20 (I'm not reporting that it doesn't compile with poppler 24.05). This is still an issue in current git.

@rouault rouault reopened this May 8, 2024
@rouault rouault self-assigned this May 8, 2024
@rouault rouault changed the title Build fails with C++20 Build fails with C++20 and PoDoFo >= 0.10 May 8, 2024
@rouault
Copy link
Member

rouault commented May 8, 2024

it's quite the opposite: the commit you linked is causing the issue,

well, not really :-) Forcing C++20 is required with Poppler >= 24.05 . But forcing C++20 also broke PoDoFo build and caused other issues (for 3.9.0). The PoDoFo issue is fixed by first commit of #9878
But if you build with Poppler, there is no point in building against PoDoFo, so it might be more robust to just disable PoDoFo support as it is rather clunky. PoDoFo builds are only useful if neither Poppler nor Pdfium are available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants