Question:
Header file #include ?
xìn xīn
2008-06-03 13:21:42 UTC
Hi, I tend to be receiving an error every I use this header file. The error states: fatal error C1083: Cannot open include file: 'termios.h': No such file or directory . The compiler I am using is Microsoft Visual Studio 2005 and the operating system is XP rather than UNIX
Five answers:
jplatt39
2008-06-03 13:43:42 UTC
Just a quick correction to what kuyote said (incidentally, I am writing this on Linux so I can't check it out):



Anything in pointed brackets: <> is a file the compiler will look for in its default directory. Sometimes programs will have as a default that they look in the include directory and its subdirectories -- so it may be in one of those. If it is you have 3 choices. You can copy it to the include directory, you can use some sort of -I flag (I don't know how Microsoft Visual C++ implements it right now) so that the compiler will look in the directory that it's in, or you can copy it to the home directory with the .cpp file.



If you put it in the directory with the .cpp file then you MUST say:



#include "termios.h"



The double quotes tell the compiler to look in the current directory. For brackets it's include, or anything added with the -I flag for double quotes it's current. Failure to do so means non-portable code.



In most versions of UNIX/Linux termios.h is in the sys subdirectory of include. Look there. If it isn't, you may not have it. DO NOT USE ANY OTHER COMPILER'S VERSION. If you can't find it, see if you can rewrite the code without POSIX compatibility. Microsoft would probably like that.



EDIT: if it is in the sys subdirectory then the best way to handle it would be to rewrite the line as:



#include
?
2016-03-17 08:34:00 UTC
Hai Rihiko Zelistha ska yg Pertama Soalnya Kereeeen bangggget NB: Oce oce
kuyote
2008-06-03 13:27:54 UTC
Do a search for termios.h Once you find this file, either add the directory that the file is in to your path... or copy it to the directory you are working in, and add it to your project.
?
2016-12-18 12:13:09 UTC
Termios.h Windows
T
2008-06-03 13:28:54 UTC
Well termois.h needs to be in the same location as your .cpp. Also that is not a standard windows header I hope you have made the termois.h header file becuase it is not a windows call.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...