Click here to Skip to main content
15,884,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
[Error] iostream.h: No such file or directory


[Error] ctye.h: No such file or directory
Posted

If you get an error message you don't understand, the first thing to do is copy and paste it into Google - the chances are that you aren't the first, and that there will be existing posts with solutions.

That's certainly true this time: Google[^] - so follow a few links and see which cause matches your exact situation. It's also quicker than waiting for us to do it for you...
 
Share this answer
 
There are no header files iostream.h and ctye.h. But there is a iostream file (without the .h extension) and a ctype.h file.

So you should use:
C++
#include <iostream>
#include <ctype.h>
 
Share this answer
 
Comments
Andreas Gieriet 5-Apr-15 5:41am    
You mean <cctype>, right?
Cheers
Andi
PS: And the C-style files exist too, but are not wrapped into std name space.
Jochen Arndt 5-Apr-15 6:28am    
My post is meant as it is. It solves the file not found errors.

It may be better (or even necessary) to include cctype but we don't know which functions are being used.
You may have a look at some C++ specification (or if you do not want to spend money for it, on a draft of it, e.g. Working Draft, Standard for Programming Language C++[^]).
See section "17.6.1.2 Headers":
[...] the contents of each header cname shall be the same as that of the corresponding header name.h, as specified in the C standard library [...]. In the C++ standard library, however, the declarations (except for names which are defined as macros in C) are within namespace scope [...] of the namespace std. [...]
The C++ headers as well as the C headers then are listed in separate tables:

C++ library headers


<algorithm><fstream><list><regex><typeindex>
<array><functional><locale><set><typeinfo>
<atomic><future><map><sstream><type_traits>
<bitset><initializer_list><memory><stack><unordered_map>
<chrono><iomanip><mutex><stdexcept><unordered_set>
<codecvt><ios><new><streambuf><utility>
<complex><iosfwd><numeric><string><valarray>
<condition_variable><iostream><ostream><strstream><vector>
<deque><istream><queue><system_error>
<exception><iterator><random><thread>
<forward_list><limits><ratio><tuple>


C library headers


<cassert><cinttypes><csignal><cstdio><cwchar>
<ccomplex><ciso646><cstdalign><cstdlib><cwctype>
<cctype><climits><cstdarg><cstring>
<cerrno><clocale><cstdbool><ctgmath>
<cfenv><cmath><cstddef><ctime>
<cfloat><csetjmp><cstdint><cuchar>


Appendix D.5 details using the "old-style" C header files.
[...] For compatibility with the C standard library [...], the C++ standard library provides the 25 C headers [...]

C headers


<assert.h><inttypes.h><signal.h><stdio.h><wchar.h>
<complex.h><iso646.h><stdalign.h><stdlib.h><wctype.h>
<ctype.h><limits.h><stdarg.h><string.h>
<errno.h><locale.h><stdbool.h><tgmath.h>
<fenv.h><math.h><stddef.h><time.h>
<float.h><setjmp.h><stdint.h><uchar.h>


[...] Every C header, each of which has a name of the form name.h, behaves as if each name placed in the standard library namespace by the corresponding cname header is placed within the global namespace scope. [...]

Cheers
Andi
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900