Orwell Dev-C ++致命错误:“iostream:没有这样的文件或目录”

问题描述 投票:1回答:1

我正在尝试编译在另一台机器上编写的Orwell Dev-C ++中的头文件。我刚刚下载了Dev-C ++,所以我对它不是很熟悉。下面是我的代码片段导致问题:

#ifndef JOB_H
#define JOB_H

#include <iostream>
#include <string>
using namespace std;

从这里,我得到以下编译时错误:

[Error] iostream: No such file or directory

但是当我注释掉#include <iostream>线时,我得到了同样的错误。

收到此消息后,我写了一个快速的“Hello World”程序并运行它没有问题,所以我很困惑可能导致上述错误消息以及我如何解决它。

c++ compiler-errors windows-8.1 iostream dev-c++
1个回答
0
投票

我找到了解决问题的方法@beed是正确的。 Dev C ++将.h扩展名关联为c文件头,因为我想将其编译为c ++头文件。我唯一的解决方案是将扩展名更改为.hpp,除非我可以在devC ++中更改文件关联

© www.soinside.com 2019 - 2024. All rights reserved.