"bsoncxx::document is ambiguous." error while using C++ Mongodb driver 3.7.1

am developing software based on C++ Mongodb driver 3.7.1 version.

I’m confronting a compiler error:

bsoncxx::document is ambiguous

in hint.hpp, client_session.hpp,‘change_stream.hpp’ and key_context.hpp etc.

Why does this happen and how do I fix it?

additional info: when I use

bsoncxx::v_noabi::page_with_curl: 

The compiler error disappears. But I know I should change the package code in C++ MongoDB Driver.

I am developing software based on C++ Mongodb driver 3.7.1 version.

I’m confronting a compiler error:

bsoncxx::document is ambiguous

in hint.hpp, client_session.hpp,‘change_stream.hpp’ and key_context.hpp etc.

Why does this happen and how do I fix it?

additional info: when I use

bsoncxx::v_noabi::document

The compiler error disappears. But I know I should change the package code in C++ MongoDB Driver.

enter image description here

Hello @Fan_Rex,

Welcome to the MongoDB Community.

The error message “bsoncxx::document is ambiguous” typically occurs in the compiler when there is a naming conflict in the code. In this case, it appears that there may be a conflict between different definitions or declarations of the bsoncxx::document type.

I recommend checking for namespace conflicts in your code.

Here are a couple of links to similar discussions that might be helpful for you:

Best,
Kushagra