一个项目怎么能不包含<string>就使用wstring呢?

How can a project use wstring without including <string>?

一个现有的 C++ 项目在 VS2017 中构建良好,但在 VS2019 中,失败并出现关于未定义符号的错误 std::wstring。 深入研究代码,<string> 从未包含在任何地方,但使用了 std::wstring,这让我摸不着头脑 ever 是如何构建的。

我碰巧在构建日志中发现了对 corecrt_wstring 的引用。 Google 没有给我太多解释,但我在这里找到了参考:https://github.com/tpn/winsdk-10/blob/master/Include/10.0.14393.0/ucrt/corecrt_wstring.h

Platform SDK 中是否提供了一些奇怪的 STL 版本或其他情况?

感谢 Ben 的提示,但事实证明 <vector> 导致 <string> 被包含在 VS2017 构建中。