Question

I am attempting to compile a header file in Orwell Dev-C++ that was written on another machine. I've just downloaded Dev-C++ so I'm not very familiar with it. Below is a snippet of my code that is causing a problem:

#ifndef JOB_H
#define JOB_H

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

From this, I get the following compile-time error:

[Error] iostream: No such file or directory

But when I comment out the #include <iostream> line I get the same error.

After getting this message I wrote a quick "Hello World" program and ran it with no problem, so I'm confused as to what could be causing the above error message and how I could solve it.

Was it helpful?

Solution

I found a solution to my problem @beed was correct. Dev C++ associates .h extensions as c file headers where as i wanted to compile it as a c++ header. The only solution i have is to change the extensions to .hpp unless i can change the file association in devC++

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top