因此,在我的CSE课程中,我们现在可以使用头文件来处理我们正在编写的程序.
不幸的是我无法使用该标头编译终端,它会产生很多错误(只用'g ++'编译).另外,当我在大学时我正在使用PuTTY时,我在使用此标题时会遇到相同的错误.但是,当我用'g ++ -std = c ++ 14'编译时,我没有得到错误.
我已经尝试在我的mac上的终端上使用此命令进行编译,但它说它无法识别c ++ 14部分.
dhcp-10-202-147-243:hw1pr1 Admin$ g++ -std=c++14 hw1pr1.cpp
error: invalid value 'c++14' in '-std=c++14'
Run Code Online (Sandbox Code Playgroud)
任何有关如何使其工作的帮助将不胜感激.希望这一切都有某种意义.
这是我用头文件编译时得到的错误我在终端只用g ++谈论.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ext/hash_map:212:5: warning:
Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>
[-W#warnings]
# warning Use of the header <ext/hash_map> is deprecated. Migrate to ...
^
In file included from read_first_name.cpp:1:
./std_lib_facilities_4.h:43:20: error: no matching function for call to object
of type 'hash<char *>'
return hash<char*>()(s.c_str());
^~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ext/__hash:39:12: note:
candidate function not viable: 1st …Run Code Online (Sandbox Code Playgroud)