Compile error when building Mongocxx driver with gcc-14

We upgraded from gcc-13 to gcc-14 and started to fail building mongocxx driver 3.6.7. Any help would be appreciated. I’m building from the source files downloaded from Mongo Github in .tar.gz format.

linux: ubuntu 20.

[ 17%] Building CXX object src/mongocxx/CMakeFiles/mongocxx_shared.dir/events/heartbeat_failed_event.cpp.o
[ 17%] Building CXX object src/bsoncxx/test/CMakeFiles/test_bson.dir/bson_get_values.cpp.o
In file included from /opt/ns/wayne/toolchain_build/mongo-cxx-driver-r3.6.7/src/mongocxx/events/heartbeat_failed_event.cpp:15:
/opt/ns/wayne/toolchain_build/mongo-cxx-driver-r3.6.7/src/mongocxx/events/heartbeat_failed_event.hpp:54:10: error: ‘int64_t’ in namespace ‘std’ does not name a type
54 | std::int64_t duration() const;
| ^~~~~~~
/opt/ns/wayne/toolchain_build/mongo-cxx-driver-r3.6.7/src/mongocxx/events/heartbeat_failed_event.hpp:68:10: error: ‘uint16_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
68 | std::uint16_t port() const;
| ^~~~~~~~
| wint_t
In file included from /opt/ns/wayne/toolchain_build/mongo-cxx-driver-r3.6.7/src/mongocxx/events/heartbeat_failed_event.cpp:16:

Hi @Wayne_Xin

3.6.7 is a 2 year old release and isn’t maintained anymore. Could you give the latest release (3.10.1) a try?

Thanks. I was able to patch the mongodb source to address the error. Using latest code would require more work to change our code to be compatible with newer version.