This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center。
7年前关闭。
这里确实发生了一些奇怪的事情。我做了一个非常简单的代码测试,以包含一个if流,但我得到一个致命错误:在编译时找不到'ifstream'文件。我怀疑这与编译器有关。
以上是使用clang++ * .cpp -o“test”命令使用clang编译的。
7年前关闭。
这里确实发生了一些奇怪的事情。我做了一个非常简单的代码测试,以包含一个if流,但我得到一个致命错误:在编译时找不到'ifstream'文件。我怀疑这与编译器有关。
#include <ifstream>
using namespace std;
int main(){
cout <<"hello world" <<endl;
}
以上是使用clang++ * .cpp -o“test”命令使用clang编译的。
最佳答案
header 名称错误,没有ifstream
header 。如果您想使用cout
,则可能要包含iostream
:
#include <iostream>
关于c++ - 无法包含ifstream “fatal error: ' ifstream'文件未找到”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16025523/