drolbr / Overpass-API

A database engine to query the OpenStreetMap data.
http://overpass-api.de
GNU Affero General Public License v3.0
690 stars 90 forks source link

Compilation fails on Archlinux #703

Closed jonas-w closed 10 months ago

jonas-w commented 10 months ago

I ran:

./configure --disable-dependency-tracking --enable-lz4
make -j4

And this error occurs on '0.7.61.6':

template_db/file_tools.cc: In member function ‘uint32 Blocking_Client_Socket::get_command()’:
template_db/file_tools.cc:82:28: error: ‘uint8_t’ was not declared in this scope
   82 |       socket_descriptor, ((uint8_t*)&buffer[0])+bytes_in_buffer, buffer.size()*sizeof(uint32) - bytes_in_buffer, 0);
      |                            ^~~~~~~
template_db/file_tools.cc:38:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   37 | #include <iostream>
  +++ |+#include <cstdint>
   38 | #include <vector>
template_db/file_tools.cc:82:36: error: expected primary-expression before ‘)’ token
   82 |       socket_descriptor, ((uint8_t*)&buffer[0])+bytes_in_buffer, buffer.size()*sizeof(uint32) - bytes_in_buffer, 0);
      |                                    ^

Same thing works on Debian. Is there a way to compile it on Archlinux?

mmd-osm commented 10 months ago

Can you try to reach out to your Archlinux community and discuss it with them in a first step? They might be in a better position to point you to Archlinux specific issues.

drolbr commented 10 months ago

Can you try to reach out to your Archlinux community and discuss it with them in a first step? They might be in a better position to point you to Archlinux specific issues.

No, Jonas is correctly reporting here. There is a missing

#include <cstdint>

in apparently more places than it looked like from the Kali problem.

I do not know why neither GCC nor Clang detect this even in pedantic mode on other platforms, but it makes it rater tricky to sport all places.

A workaround would be to add

#include <cstdint>

in all files where the compiler complains, but that could be as well subject of a patch release.

mmd-osm commented 10 months ago

I thought this might be something ArchLinux specific, like in https://github.com/AirenSoft/OvenMediaEngine/issues/1271 ... The issue suggests that the missing "std::" namespace for uint8_t is causing the issue. However, the error message there is slightly different.

Maybe worth noting: They have resolved the issue by including stdint.h since they prefer using uint8_t over std::uint8_t.

drolbr commented 10 months ago

On 22.08.23 00:24, Jonas Wunderlich wrote:

I ran:

|./configure --disable-dependency-tracking --enable-lz4 make -j4 |

And this error occurs on '0.7.61.6': [..]

Thank you for reporting this. It should be fixed in 0.7.61.7

jonas-w commented 10 months ago

Thanks for investigating my issue, but this does not seem to have fixed it, also looking at the diff between the .6 and .7 tar file, there is no code change except the version number.

mmd-osm commented 10 months ago

I tested this on an ArchLinux docker image now. Like the compiler error message above states, the only missing thing was an #include <cstdint> in template_db/file_tools.cc line 38.

template_db/file_tools.cc:38:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?

drolbr commented 10 months ago

I'm sorry for putting it in the wrong branch. Should be fixed in 0.7.61.8

jonas-w commented 10 months ago

@drolbr sorry for the late response, just tested it, except of the lz4 deprecation warning there are no errors and it compiles. Thank you!