如何修复 C++ 'fatal error: stringstream: No such file or directory'
问题:
你的 C++ 代码包含类似这样的一行
main.cpp
#include <stringstream>因为你想使用 std::stringstream,但你的编译器给你这个错误消息:
error_message.txt
main.cpp:2:10: fatal error: stringstream: No such file or directory
#include <stringstream>
^~~~~~~~~~~~~~
compilation terminated.解决方案
头文件名为 sstream,而不是 stringstream!改用此 #include 指令:
main_fixed.cpp
#include <sstream>Check out similar posts by category:
C/C++, GCC Errors
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow