fix: Enable use of C++20 for compatibility with poppler 24.05 #961
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Poppler uses
std::string::starts_with
since poppler/poppler@fbb645. This commit (fbb645) is included inpoppler 24.05
. This change also affects the public headers of GooString, which means that all projects depending onpoppler
need to be aware ofstd::string::starts_with
, even if they don't use it themselves.std::string::starts_with
is new with C++ 20 (see above), which means that OpenBoard must also be compiled with C++ 20. Otherwise, this error occurs:Possible solutions
poppler
. I haven't found a way to cleanly achieve this. Might mean that devs have to test with different versions of poppler.Solution presented in this PR
Solution 3 is the most straightforward fix, so this is chosen here.Edit: Changed to solution 1 since dropping support for older distros like Ubuntu 20.04 is undesirable. It's also more flexible considering that this situation already occurred with the transition to C++17.
Conclusion
OpenBoard will eventually have to move on to C++ 20. Support for that is mostly complete in GCC, but still considered experimental. Poppler already requires it to build starting with 24.05, which afaics is only packaged with Arch Linux at this stage. Naturally, this will change in the future.
Fixes #958
Suggestions and feedback are always welcome!
-- Vekhir