Skip to content
New issue

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

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

Already on GitHub? # to your account

Missing #include <algorithm> #252

Closed
pouriamoosavi opened this issue Jun 9, 2022 · 5 comments
Closed

Missing #include <algorithm> #252

pouriamoosavi opened this issue Jun 9, 2022 · 5 comments

Comments

@pouriamoosavi
Copy link

Hi hope you are well.

For some reason it seems that #include <algorithm> is missing in multiple files which results in errors like no matching function for call to 'find' or ‘transform’ has not been declared in ‘std’ when making the application.

I'm not sure what is the right solution for this but I just went through these files and add #include <algorithm> at the top.

Is there something that I'm missing?

By the way I'm using GNU Make 4.3 gcc version 11.2.0 on Ubuntu 20.04

@tomhughes
Copy link
Contributor

It's probably just that older compilers include it as a side effect of including some other header so nobody noticed until now.

@mmd-osm
Copy link
Collaborator

mmd-osm commented Jun 9, 2022

GCC 11 has a few header dependency changes: https://www.gnu.org/software/gcc/gcc-11/porting_to.html, so that's not completely unexpected. I'd suggest to take a look at the Dockerfile instead for the time being, as that's still working fine.

@pouriamoosavi
Copy link
Author

pouriamoosavi commented Jun 9, 2022

Thanks for fast response.

I actually solved it by adding #include <algorithm> include in these files in src directory:

request_helpers.cpp
text_formatter.cpp
xml_formatter.cpp

Maybe it would help others in the future. After that, everything works fine.

Thanks again.

@mmd-osm
Copy link
Collaborator

mmd-osm commented Jun 10, 2022

I think this need to be addressed at the latest when switching to Ubuntu 22.04. Until then, I'm leaving the issue open.

mmd-osm added a commit to mmd-osm/openstreetmap-cgimap that referenced this issue Jun 28, 2022
@mmd-osm
Copy link
Collaborator

mmd-osm commented Jul 1, 2022

Fixed in #255

@mmd-osm mmd-osm closed this as completed Jul 1, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants