gpt4 book ai didi

c++ - 当包含 Stroustrup 书中的 std_lib 时,不理解 VS 中 HelloWorld 的错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:22:06 27 4
gpt4 key购买 nike

<分区>

我包含了来自 Stroustrup 网站的 std_lib我的代码是:

#include "c:\Users\theresmineusername\Documents\Visual Studio 2017\std_lib_facilities.h"

int main()
{
cout << "Hello, World!\n";
return 0;
}

所以我得到了 2 个错误:

1. E1574    статическое объявление не удалось по причине "<hash_map> is deprecated and will be REMOVED. Please use <unordered_map>. You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning."   ConsoleApplication2 c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.24930\include\hash_map

2. C2338 <hash_map> is deprecated and will be REMOVED. Please use <unordered_map>. You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning. ConsoleApplication2 c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24930\include\hash_map

从书的开头开始使用“std_lib_facilities.h”,除了这个 std_lib 的路径之外,我的代码都与书相同。有人可以解释这是什么意思吗? Can 继续阅读这本书。

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com