“bsoncxx::document is ambiguous.” 在使用 C++ MongoDB 驱动程序 3.7.1 时出现错误。

huangapple go评论56阅读模式
英文:

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

问题

我正在开发基于C++ MongoDB驱动程序3.7.1版本的软件。

我遇到了一个编译器错误:

bsoncxx::document存在二义性

hint.hppclient_session.hppchange_stream.hppkey_context.hpp等文件中。
附加信息:
当我使用“bsoncxx::v_noabi::document”时,编译器错误消失。
但我知道我不应该更改C++ MongoDB驱动程序的包代码。

为什么会发生这种情况,我应该如何修复它?

英文:

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.
additional info:
when I use "bsoncxx::v_noabi::document", the compiler error disappears.
But I know I should not change the package code in C++ MongoDB Driver.

Why does this happen and how do I fix it?

“bsoncxx::document is ambiguous.” 在使用 C++ MongoDB 驱动程序 3.7.1 时出现错误。

Here are the project references:

“bsoncxx::document is ambiguous.” 在使用 C++ MongoDB 驱动程序 3.7.1 时出现错误。

答案1

得分: 1

好的,以下是翻译好的部分:

"Ennnn"格式的错误代码表示这些是智能感知错误。智能感知是一个快速扫描器,旨在提供关于简单错误的反馈,以及在输入时自动完成功能。然而,它并不完美,有时会产生误报。智能感知错误不会阻止真正的编译器编译您的代码。

您有几个选项。您可以关闭智能感知(这是我的选择,我发现它更麻烦而不值得)。您可以忽略它。您可以重新构建“智能感知数据库”。有时智能感知会自己搞混,如果您将其删除,它会自己解决问题。找到您解决方案文件夹中的.vs文件夹并将其删除。

英文:

OK the Ennnn format for the error codes mean these are Intellisense errors. Intellisense is a fast scanner meant to provide feedback on simple errors, as well auto complete features while you are typing. However it's not perfect and sometimes produces false positives. An Intellisense error will not prevent the real compiler from compiling your code.

You have a few options. You could turn off Intellisense (this is my choice, I find it is more trouble than it is worth). You could ignore it. You could rebuild the 'Intellisense database'. Sometimes Intellisense gets itself confused and if you nuke it, it sorts itself out. Find the .vs folder in your solution folder and delete it.

huangapple
  • 本文由 发表于 2023年7月11日 04:17:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/76657058.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定