-
July 5th, 2006, 06:00 AM
#1
Cannot open include file: 'iostream.h
Hi,
I am attempting to build Borland C++ 4.5 code on the VC++6.0 environment.
For a set of files I attempt to compile after creating a workspace, I get the following set of errors-
Code:
fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory
fatal error C1083: Cannot open include file: 'string.h': No such file or directory
fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
fatal error C1083: Cannot open include file: 'string.h': No such file or directory
fatal error C1083: Cannot open include file: 'fstream.h': No such file or directory
fatal error C1083:Cannot open include file: 'process.h': No such file or directory
fatal error C1083: Cannot open include file: 'time.h': No such file or directory
I have looked through the internet and as per the general solution to these sort of issues have done the following-
Change #include <iostream.h> to #include <iostream>
Add "using namespace std;" below the #include statements.
Despite doing the above, I still get errors like -
Code:
fatal error C1083: Cannot open include file: 'iostream': No such file or directory
The header files (both iostream.h and iostream) do exist in my machine and the path is specified in the Tools->Options->directories->Include files section.
Can someone please share your suggestions on a possible solution ?
-
July 5th, 2006, 06:03 AM
#2
Re: Cannot open include file: 'iostream.h
Check if "Ignore standard include path" is checked in project settings->C++->preprocessor
Regards,
Ramkrishna Pawar
-
July 5th, 2006, 06:11 AM
#3
Re: Cannot open include file: 'iostream.h
Originally Posted by humble_learner
The header files (both iostream.h and iostream) do exist in my machine and the path is specified in the Tools->Options->directories->Include files section.
Can someone please share your suggestions on a possible solution ?
First, do not use <iostream.h> even if it exists on your system. You should be using the standard header, <iostream>.
Second, your include path settings are probably incorrect, and you should consult your compiler's documentation on how to set the compiler's include path correctly.
Regards,
Paul McKenzie
-
July 5th, 2006, 06:27 AM
#4
Re: Cannot open include file: 'iostream.h
Normally these files should automatically be put into your path when you install your compiler. V6.0 is rather old though, you should consider an upgrade.
-
July 5th, 2006, 06:47 AM
#5
Re: Cannot open include file: 'iostream.h
dont forget to add using namespace std;
It takes seconds for rating…that actually compensates the minutes taken for giving answers
The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you.
Regards, Be generous->Rate people
Jayender!!
-
July 5th, 2006, 07:03 AM
#6
Re: Cannot open include file: 'iostream.h
Hi,
Thanks for your answers.
The include path specified in the Tools/Options/Directories/Include is correct.
I tried using #include<iostream> with "using namespace std" but the problem remained.
The customer expects the porting from BC++ to VC++6.0 and hence have no other option but to user VC++6.0
I checked the "ignore standard path" option in preprocessor settings but the problem remained.
-
July 5th, 2006, 07:05 AM
#7
Re: Cannot open include file: 'iostream.h
I see no reason why this problem should come, is it possible to post the project here ?
Regards,
Ramkrishna Pawar
-
July 5th, 2006, 07:26 AM
#8
Re: Cannot open include file: 'iostream.h
Originally Posted by jayender.vs
dont forget to add using namespace std;
as long as it's not in a header file, and it's often preferable to not add that in a source file either.
If all you are using is cout and endl you can do:
Code:
using std::cout;
using std::endl;
And that would be reasonably acceptable in a header file in this instance as it's unlikely anyone would define cout and endl to mean anything else. (Don't apply this rule in general though).
In a header file you can often include <iosfwd> rather than <iostream>.
-
July 6th, 2006, 07:29 AM
#9
Re: Cannot open include file: 'iostream.h
I am sorry for the oversight. Krishnaa's solution worked. I might have made some other mistake in my hurry to get things working.
The errors were gone when I compiled once again after checking
the [Ignore standard include paths ] check box in the C/C++ - Preprocessor option.
What does checking of the option actually do to solve such errors ?
Thanks for your time.
-
July 6th, 2006, 07:38 AM
#10
Re: Cannot open include file: 'iostream.h
VC++ uses Environment variables like Include , Lib. These variables represent the paths for respective files.
In your case these variables must have been modified/corrupted/removed, causing the problem reported.
You can confirm this by looking at Environment Variables in System properties, Right click on "My Computer"->Advanced Tab ->Environment Variables button.
See if include, lib, MSDevDir etc. are there and have proper values.
You will have to reinstall(completly uninstall and install again) VC++ in order to get them back. You can manually assign values but reinstall is easy.
Regards,
Ramkrishna Pawar
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|